7 replies [Last post]
anotherhoward
anotherhoward's picture
Offline
Enthusiast
Heartland of South Jersey
Last seen: 13 years 13 weeks ago
Heartland of South Jersey
Timezone: GMT-4
Joined: 2006-11-16
Posts: 86
Points: 0

If you look at my page at http://www.mettapress.com/pharma/mp-home5.html there's space above my two links (home and contact) in the mid-purple color area that I can't get rid of. What's causing it, and how can I remove it?

Thanks,
Howard

Here's my validated code:

Pharma Technical Writer Services

body,
html {
margin:0;
padding:0;
background:#a7a09a;
color:#000;
}
body {
min-width:750px;
text-align:center;
font-family: verdana, arial, sans-serif;
font-size:.9em;
}
#wrap {
background:#99c;
margin:0 auto;
width:90% /* 750px; */
}
#header {
background:#ccccff; /* was #ddd */
}
#header h1 {
padding:5px 5px 0 5px;
margin:0;
font-size: 1.8em;
font-family: Arial, Verdana, sans-serif;
font-weight: 700;
color: #24018D;
text-align: center;
}
#header h3 {
padding-bottom:.5em;
padding-top:0em;
color:red;
}
#nav {
background:#99c;
padding:0 5px 5px 5px;
text-align:left;
}
#nav ul{
margin:0;
padding:0;
list-style:none;
}
#nav li{
display:inline;
margin:0;
padding:0;
}
#main {
background: #ffffff;
float:right;
width:85%; /* was 540px */
text-align:left;
padding: .5em 1em 1em 1em;
/* Was padding-bottom: 1em; */
}
#main h2, #main h3, #main h4, #main p {
padding:0 10px;
}
#sidebar {
background:#99c;
float:left;
width:15%; /* was 200px */
}
#sidebar ul {
margin-bottom:0;
}
#sidebar h3, #sidebar p {
padding:0 10px 0 0;
}
#sidebar img {
padding-left:4px;
}
#footer {
background: #CCCCFF;
clear:both;
}
#footer p {
padding:5px;
margin:0;
font-size:.8em;
}
.red {
color: #f00;
font-weight:600;
}

You're in the pharmaceutical industry. You need a technical writer to produce technical documentation, someone experienced doing that in the pharmaceutical industry. Not someone who's only done it for the financial industry or the IT industry. We've done it exclusively in the pharmaceutical industry for the past xx years. That's the first reason you should contact us.

Here are three more reasons why you should contact us.

  • You want your due diligence documented.
  • You want it done on time and correctly. We've produced [ types of documents] on time and correctly for [ companies].
  • You want it done "your way." One of our strengths is our ability to collaborate with your subject matter experts to acquire the specific information needed to satisfy your project's documentation requirements.

If that's good enough for you, contact us today and learn how we can satisfy your technical writing needs. And if it's not enough, let us know what else you require. We might be able to meet that too.

[/][/]

Web pages work better with CSS

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 6 years 34 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

add this: #header h3

add this:
#header h3 {
padding-bottom:.5em;
padding-top:0em;
color:red;
margin-bottom: 0;
}

anotherhoward
anotherhoward's picture
Offline
Enthusiast
Heartland of South Jersey
Last seen: 13 years 13 weeks ago
Heartland of South Jersey
Timezone: GMT-4
Joined: 2006-11-16
Posts: 86
Points: 0

Reply to wolfcry911

Thanks. That solved it.

What I don't understand is why the h3's bottom margin had to be set to zero.

My code contains these rules:

body,
html {
margin:0;
padding:0;

I thought that the above margin:0 would zero out all the margins.

Howard

Web pages work better with CSS

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 44 weeks 7 hours ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

anotherhoward wrote:Thanks.

anotherhoward wrote:
Thanks. That solved it.

What I don't understand is why the h3's bottom margin had to be set to zero.

My code contains these rules:

body,
html {
margin:0;
padding:0;

I thought that the above margin:0 would zero out all the margins.

Well no, it shouldn't according to the standards. Your rule only applies to two elements, HTML and BODY. If you want to zero out margins and padding for everything you must use the universal selector so:

* {margin:0; padding:0;}

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

anotherhoward
anotherhoward's picture
Offline
Enthusiast
Heartland of South Jersey
Last seen: 13 years 13 weeks ago
Heartland of South Jersey
Timezone: GMT-4
Joined: 2006-11-16
Posts: 86
Points: 0

Question

But isn't the h3 element a child of both the html and body elements, so shouldn't it inherit their margin settings?

Hmm. I just read on www.westciv.com that "An element does not inherit the margin property of the element which contains it." That answers my question.

Web pages work better with CSS

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 44 weeks 7 hours ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

anotherhoward wrote:But

anotherhoward wrote:
But isn't the h3 element a child of both the html and body elements, so shouldn't it inherit their margin settings?

Hmm. I just read on www.westciv.com that "An element does not inherit the margin property of the element which contains it." That answers my question.

Right. And margins and borders are also not inherited. Otherwise if you put a border around the BODY element every child element would get the same border unless you explicitly over-ruled it with a local border rule. What a pain!

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

anotherhoward
anotherhoward's picture
Offline
Enthusiast
Heartland of South Jersey
Last seen: 13 years 13 weeks ago
Heartland of South Jersey
Timezone: GMT-4
Joined: 2006-11-16
Posts: 86
Points: 0

Question for Ed

Ed,

You wrote that "margins and borders are also not inherited." Did you mean to repeat "margins"?

Howard

Web pages work better with CSS

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 44 weeks 7 hours ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

anotherhoward wrote:You

anotherhoward wrote:
You wrote that "margins and borders are also not inherited." Did you mean to repeat "margins"?

That should have been "padding and borders". The point being that there are some properties you really don't want to cascade.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.