How should I set a custom style on a object that is a gwt component?

Tags: java,html,css,gwt,web-development-server

Problem :

I am using Java (Eclipse) and for the web development I use gwt. The object that I want to change (loader) has a default font-size. It also has a method named setHtml(String). I have almst no knowledge on on HTML and CSS and how should I integrate such files in java code. I've been told that I should write something like: loader.setHTML("<span class = 'something>'" +.... ) What this something should be? Does it have to be an .css file and just the path to it?

Solution :

There are two ways to do that.

First, you can define the rule in CSS. You do need to learn HTML and CSS for web development - no way around that.

Second, you can set a particular CSS property directly in your code:

loader.getElement().getStyle().setFontSize(24, Unit.PX);

    CSS Howto..

    How to remove css and javascript code in source code of website

    How to get div height 100% inside td of 100%

    How to do something like #Card%{ } in CSS

    how to add active css class to a link in Wordpress

    How to apply style rules that are tied to a model in AngularJS?

    How to change width to fill the remaining space (CSS)

    How can I get a button on the side of a text box to be perfectly aligned all the time?

    using the unorthodox `head {display: block}` to show text to user?

    How to create CSS dropdown

    How do I use a wildcard asterisk CSS selector in SASS? [closed]

    How can i create a hexagon shape with an image inside? [duplicate]

    How to make a CSS border for a dropdown menu?

    How to use psd elements in an upload form? [closed]

    How to write CSS keyframes to indeterminate material design progress bar

    CSS: How to refer to a tag

    How do I make two divs in the same “row” float in different directions?

    Calculating percentages for 10 or more images in a CSS3 slideshow

    How to work with dynamic container in Isotope?

    How to disable CSS in Browser for testing purposes

    How to edit itemprop in div class in CSS? (Wordpress)

    How to calculate the length in pixels of a string with php - from another page on my website

    How to make CSS menu bar activated only after my mouse cursor is at the menu.

    How to copy the CSS to another tab in Chrome?

    How to create CSS for round, responsive, bootstrap button with border? Border is affecting pixels

    How to toggle fade a DIV when hovered over an image

    How can I eliminate the space above my list?

    How to make a new DOM element to think it resides in a different domain with js and css

    I'm having trouble with Safari and CSS. How do I fix the issue without affecting Chrome?

    CSS - How to make a div's padding not affect the positioning of the div below it

    How can I turn the page's font color to green when a button is clicked