Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6672843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:33:22+00:00 2026-05-26T03:33:22+00:00

I have a GWT view with an image dropped into the view as a

  • 0

I have a GWT view with an image dropped into the view as a DataResource (to set the img src equal to the base64 image path instead of the default setting css background to the ) like so:

Image img = new Image(ICONS.red().getUrl());
img.setStyleName("myImgStyle");
panel.add( img );

My ICONS resource bundle looks like:

@Source("red.png")
DataResource red();

This generates the following html in the generated document (src truncated):

<img src="<base64 encoded path>" class="myImgStyle" style="width: 16px; height: 16px;">

My issue is with the inline styling in the img tag. I’m declaring style for .myImgStyle in the attached CSS file in several different @media sections so I can size the image for different devices. However, the inline styling in the img tag overrides the style defined in the CSS. I’ve tried setting styleName and setting style primary name in the GWT source to no avail. How can I render the img tag without the inline style in the img tag?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:33:23+00:00Added an answer on May 26, 2026 at 3:33 am

    You can explicitly remove the height and width from the Image by accessing its Style:

    img.getElement().getStyle().clearHeight();
    img.getElement().getStyle().clearWidth();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GWT project set up with multiple module files (they inherit a
I am not being able to import com.google.gwt.view.client.ListViewAdapter;. I have GWT 2.1 and it
I have a view that I created in my GWT application and I would
I'm trying to create a login view with GWT Designer. I have the styles
I have my GWT code in an index.jsp page, and when I view the
Anyone have GWT 1.6.4 running on FreeBSD? Our build server is a FreeBSD box,
Does gwt have (good) support for effects, moving around elements, and resizing them? Are
I have a gwt project that uses gwt-mosaic. Here is the error message I
I have a GWT project in which I need to manually specify currency, number
I have a GWT app that makes an RPC call to a server to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.