/    Sign up×
Community /Pin to ProfileBookmark

firefox vs IE – css background position

hi everyone,
i am trying to set a horizontal line, so i am using background-imagte and backgroun-position that should be in em for zooming reasons. the thing is …it is visualized perfectly under firfox mozilla browser while not under IE. how can i overcome this??? thanks in advance.

here is the css

body{ background-image:url(files/images/backLine.gif);
background-position: 0 1.31em;
background-repeat: repeat-x ;}

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelJan 05.2008 — You could just use an 'empty DIV' with a border-top:

<div style="width:auto; height:1px; margin:0 1.31em; [B]border-top: 6px solid blue;[/B]">

<!-- this is an empty div: presentational "[I]horizontal ruler[/I]" -->

</div>[/QUOTE]
Of course this won't do if your 'image' is an actual image, as this border rule is a [B]solid color[/B] (blue).

For an actual [I]image [/I]to be used this way (as a border), -wait for CSS3. ?

A 'cure' for that interim, is a minor revisit:

<div style="width:auto; [B]height:6px;[/B] margin:0 1.31em; [B]background:url(image.jpg) repeat-x[/B]>

<!-- this is an empty div: presentational "[I]horizontal ruler[/I]" -->

</div>[/QUOTE]
Both examples create a "6px tall' horizontal ruler. the second example assume that the image is 6px tall (and whatever width, not important), thus, it fills the 6px height of the DIV, and repeats along the x-axis. This too, creates a 'horizontal ruler'. And, since "<hr>" is somewhat deprecated, the above example is somewhat better.
Copy linkTweet thisAlerts:
@CentauriJan 06.2008 — If the background position needs to change to cater for text resize, then it probably should be attached to the element associated with the text, rather than the body. Got a link to this online ?
Copy linkTweet thisAlerts:
@nihaauthorJan 08.2008 — well not yet but the designers need the horizontgal line to be 100% width of the page while the main content is centralized sighhhhhhhhhh
Copy linkTweet thisAlerts:
@CentauriJan 08.2008 — Judging by the example you posted at the start, I assume this is to underline a header section, links or something? If so, the page could start with a ull width header. containing the line graphic at the bottom of it, and the contents constrained and centred within this. The rest of the site following could then have the desired width and be centred as normal.
Copy linkTweet thisAlerts:
@nihaauthorJan 08.2008 — ahhhhh that is an idea! great thanks alot
×

Success!

Help @niha spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...