• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

CSS question about font/text code

bluestrobe

Platinum Member
I am in the process of cleaning my website's code up. In the css file I have this code:
body,h1,h2,h3.h4,h5; {
margin:2%;
padding:0px;
}

However this doesn't work and I have to have individual code like this to control margins.
h4 {
margin:2%;
padding:0px;
}

h5 {
margin:2%;
padding:0px;
}

p {
margin:2%;
padding:0px;
}

Is there a reason the top code doesn't work? Sorry for the noob CSS question.
 
body,h1,h2,h3.h4,h5; {
margin:2%;
padding:0px;
}


assuming that is a direct copy, the problem is the ; after the h5.
 
body,h1,h2,h3.h4,h5;

There's a period after h3 too. lol.

body,h1,h3,h3,h4,h5 {
asdf: asdfjkl;
}

That's all you've got to do. 😉
 
Originally posted by: xtknight
body,h1,h2,h3.h4,h5;

There's a period after h3 too. lol.

body,h1,h3,h3,h4,h5 {
asdf: asdfjkl;
}

That's all you've got to do. 😉

Yea, I see that now. Like I said, little things....

 
body,p,h1,h2,h3,h4,h5 {
margin:2%;
padding:0px;
}

This is what I have and I still have margin problems with the "h" and "p" tags like the above code doesn't exist. Am I grouping too much into one entry or does that even matter?
 
What does your actual HTML look like? Are you nesting the tags, like maybe a "h" tag inside a "p" tag? What effect is it giving you, and what are you trying to make it do?
 
Originally posted by: GoatMonkey
What does your actual HTML look like? Are you nesting the tags, like maybe a "h" tag inside a "p" tag? What effect is it giving you, and what are you trying to make it do?

All the tags to the best of knowledge are correct. What's hurting me at this point is the spacing from the edge of the cell or the "margin". If I take out the individual CSS code for each tag, then the text rides right on the boarder of each cell without any margin.

Originally posted by: George P Burdell
Can you post the relevant HTML and ALL of the CSS?

css code

Web site

The margin errors happen on all pages.

 
Originally posted by: GoatMonkey
Should I be afraid to click on those links at work? Police posers sounds like strippers dressing as cops.


it's all safe for work. My web site is about police and fire department imposters and lighting abuse.

Originally posted by: George P Burdell
This may not be anything, but can you change:

<style type="text/css">


body,p,h1,h2,h3,h4,h5 {
margin:2%;
padding:0px;
}

to

body,p,h1,h2,h3,h4,h5 {
margin:2%;
padding:0px;
}

(remove the html tag from your css file, and make sure there are no whitespaces or newlines before the first line).

That worked great. Thanks!
 
Back
Top