May 16, 2008

Link Image Css Bug In Firefox - Can anyone help me?

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > CSS (Cascading Style Sheets)

free web hosting

Link Image Css Bug In Firefox - Can anyone help me?

darran
I have a problem in a site I am creating.

I have styled my post content <a> links in the following way.

CODE
#post-content a {
    background-color: #bf6f3c;
    color: #fff;
    padding: 2px 2px 1px 2px;
    border-bottom: 1px solid #7f4926;
}

#post-content a:hover {
    color: #f5fac7;
}


And when I insert an link image like so: <a href=""><img src="" /></a>

There seems to be an extra border inherited from my #post-content a style. I have attached the screenshot to show the problem.

This was how my link image should look like:

CODE
#post-content a img {
    background-color: #bf6f3c;
    padding: 5px;
    border-bottom: 1px solid #7f4926;
    border-right: 1px solid #7f4926;
}


Can anyone guide me as to how I can fix this problem?

My site URL is here

 

 

 


Reply

truefusion
I've had this problem before when making my gallery script. This "extra border" is really the anchor element that's surrounding the image element. Since the anchor element is a inline-level element, it doesn't stretch to go around the image which is block-level. The easiest way to fix it is to remove the style which you attached to all anchors in the parent element. Another way is to make these anchor elements block-level with a predifined height and width, and probably just set the image as a background to these specific anchors. You could probably also force everyone to upgrade their Firefox to version 3. I'm not sure of any other ways to try and solve this problem.

Reply

jlhaslip
CODE
#post-content a.lightview {           style.css (line 240)
background-color:#FAFAFA;        // same background-color as the surrounding area on the page
}

Reply

darran
I am not sure whether I have fixed that problem. Take a look again.

What I did was to set a class 'lightview' to my anchor and then reset the styles I used with this:

CODE
#post-content a.lightview, #post-content a.lightview:hover { /* Reset link styling */
    background: none;
    border: none;
    padding: 0;
}


Not sure if that is the 'correct' method of doing things.

Is version 3 already out? I haven't received any updates.

Reply

jlhaslip
That code will work.
The only trouble with it is that the "newest" browsers, Firefox 3 Beta, IE8 Beta and Opera 9.2something, treat the pixel values of a page as data for enlargement now, so even images are enlarged according to the magnification factor.
Your page at least stays within the boundaries of the header background, so it looks pretty good even up to 200% enlargement.

FF3 and IE8 are released for Development testing only. They are not "public" releases yet. They can be freely downloaded at the appropriate sites.


Reply

Inhuman
Try using this:

CODE
<img src="IMAGE URL HERE" border="0">


I used that on my site and it works fine.

Reply

jlhaslip
QUOTE(Inhuman @ Apr 12 2008, 10:43 AM) *
Try using this:

CODE
<img src="IMAGE URL HERE" border="0">


I used that on my site and it works fine.

The problem is not the border on the image. The opening poster wants that border.

The issue is the background colour of the inline anchor tag which needed to be eliminated.
Adding the class to the anchor and removing the background colour handles the issue nicely, in a standards compliant fashion.

Reply

Inhuman
HA! Totally misinterpreted that. I think I should pay more attention. dry.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : link, image, css, bug, firefox,

  1. Centering A Div Containing Image.
    I have a logo I need centered in a aujustable width page (9)
  2. How To Make Design Css With Firefox/iexplorer?
    (7)
    Am using css for designing my sites in that i had a problem while design css for iexplore it show
    good in iexplorer and the same design view differently in firefox what should i do to avoid such
    difference.....
  3. Css Alignment Bug
    Moves my page when I click on a link (10)
    This is a bug I am really confused by and I hope I can get some help over here. I am in the midst
    of creating my very own WordPress Theme for my site which involves full styling using CSS. I am
    moving away from tables. I have a layout which is 770px in width (fixed), and I want to align it
    to the center. Ideally, this is what I put in my CSS. CODE #wrapper {    margin: 0 auto 0
    auto; } This visually looks fine on my browser at first. But when I click on say, a post
    permalink which will bring me to the view the entire post. The entire layout shifts to t....
  4. Css Scrollbars In Firefox?
    (9)
    Ok, I wasn't too sure weither this topic would be better under Internet or Software, so if it is
    in the wrong place please forgive me. I have a question about web browsers. I currently use
    Firefox and I was wondering if there is a way to get FireFox to display CSS Scrollbars, like Opera
    and Internet Explore do. I've currently looked at the FireFox Add-On site and did a few
    searches on Google and I have come up with nothing and I'm getting a strange suspision that
    there is no way to do such a thing. If anyone can help I will be forever grateful. /biggri....
  5. Centering Background Image In Css
    (8)
    Well, the title says what I need. Basically, I want a background image that can be used in the body
    or inside a div (or table), which is centered.....
  6. Css Positioning Trouble
    in FIREFOX! yet IE displays it as i want (6)
    Wait wait! im not complaining about firefox! i couldnt ever do it, but the fact is that for
    the very darn first time IE is actually showing the thing as i want it... I have a table inside a
    div, and i want the table to be right aligned, and IE6 does so (not the same for ie for mac though)
    but firefox keeps it to the left, the best thing i've achieved with this is a fixed position
    which does not look good while resizing...... ive also tried floating and even adding a wrapper...
    so i dont know what to do... this is the site: http://www.cucea.udg.mx/cucea/gr....
  7. Css Image Position Problem
    align image left or right (1)
    I am having problems figuring out why my image will not align how I want it. Here , you can see
    that the image is aligned to the left. This is the code for that block: CODE <a
    href="http://img355.imageshack.us/img355/844/r25870774779uu.jpg"><img
    src="http://img355.imageshack.us/img355/844/r25870774779uu.th.jpg" alt="bush
    bathroom break note" align="left" style="margin-right:
    5px;"></a>[text goes here] But if you go here , you can see that the
    text does not stay to the right of....
  8. Problem With Mozzilla Firefox And Css
    (3)
    If someone got Mozilla Firefox then: Here there is site: http://luckyclover.trap17.com/ In (IE,
    Opera) other browsers this page is showing propetly but Mozzilla don't show BG image in tables
    always when i use style class from CSS just eat whole row. The last menu on right don't use
    style class from css and mozzila show all BG images. Someone know what CSS function mozzila not
    support or meybe this is a bug ? If you guys see source code in mozilla you see there is code for
    this stuff but mozilla ignore them. HELP /cool.gif' border='0' style='vertical-align....
  9. Css Image Replacment
    using CSS to change the image path (5)
    I was wondering if it is possable to change the path to an image using CSS, so that I could provide
    a sort of template system rather then having to change a bunch of thing I could have astandard page
    and then by changing the external CSS I could change not only styles but the whole image, I soo how
    I could change the background-color { url(image.gif)} but whatabout an actual image say change the
    src of an img tag?....

    1. Looking for link, image, css, bug, firefox,

Searching Video's for link, image, css, bug, firefox,
advertisement



Link Image Css Bug In Firefox - Can anyone help me?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE