Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- Center Background Image


rocknbil - 3:59 pm on Mar 14, 2012 (gmt 0)


Well, your last suggestion would (should, see below) work but #login_logo a refers to an anchor inside the element #login_logo - #login_logo is the ID'ed element. a#login_logo is correct too. Look:

<a href="" id="login_logo">

If you classed it,

<a href="" class="login_logo">

this would look more common

a.login_logo

Bottom line is unless you have another element ID'ed as login_logo (which you absolutely shouldn't, id's need to be unique, that's what makes them ID's) this should also work.

#login_logo {}

They probably did that because there's other anchors being styled inside the parent container and needed to specify a#[the id].

Returning to the problem: there's a couple things going on. You say "background image" but have in inline image specified:

<a href=""><img></a>

Is that the image you're referring to? Is it because the logo used in the img tag is larger than the container holding it?

a#login_logo{
position: absolute;
top: 0;
left: 404px;
height: 129px;
margin: 0 auto;
width: 192px;
}

Also, anchors are inline elements by default, I don't see where the block property is added, but it should work out if you use an inline image. The anchor element itself just won't actually wrap around the logo and will only have the height of whatever font settings are on this element (use the FireFox Firebux extension to see this effect.)


Thread source:: http://www.webmasterworld.com/css/4428954.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com