/    Sign up×
Community /Pin to ProfileBookmark

Firefox and margins

I’m a newbie…well, newbie to the hardcore div side of CSS, I’ve been using CSS for years just making my links look interesting with a:hover because I had absolutely no knowledge that CSS can do, well, what it does. That’s besides the point. I’ve recently started to get into it and I need some beginner’s help….very beginner.

I have a div nested in another and I am trying to pad some the material in the nested div on the right, so it doesn’t go all the way to the edge of the div it’s nested inside of (please no interesting insight here, I know this is exactly what I want to do). I don’t know how to make this look acceptable in FireFox though. these commands are fine in everything but FireFox:

padding-right: #;
margin-right: #;
right: #;

Please help, I’m thinking about resorting to using several   (I know, THAT’S desparate).

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@drhowarddrfineMay 07.2006 — The problem may lie in either the "other" browsers or whether you use a doctype or not. Firefox is probably correct in its behavior but, without code, we can't tell.

Are you using a doctype? If not, see my link below. Use html4 strict.
Copy linkTweet thisAlerts:
@aj_nscauthorMay 07.2006 — Ok, HTML 4 strict does me no good. Thanks for the reply though. I'll put it up to any developer that it is as simple as this:

I have a container with a white background (absolute positioning), not quite the full width of the page, and say its height is 100px. I have a box in this container (relative positioning) with a black background which is the full width of it's container, but not the full height. I want all content in this box with the black background to go to the right of the container, but stay 15px away from the right edge.

I don't know how to do this in Netscape/FireFox......any help?
Copy linkTweet thisAlerts:
@felgallMay 07.2006 — text-align:right;margin-right:15px;
Copy linkTweet thisAlerts:
@drhowarddrfineMay 07.2006 — <i>
</i>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;

&lt;style type="text/css"&gt;

&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div style="position:absolute;width:90%;height:100px;border:1px solid red"&gt;
&lt;div style="position:relative;height:50%;text-align:right;margin-right:15px;background-color:#000"&gt;
&lt;p style="color:white;"&gt;text here&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
×

Success!

Help @aj_nsc 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.24,
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,
)...