newbie: css & "removing blank line between paragraphs"

J

Jeff

html code:
<p class=menu><a href=#>Hello world</a></p>
<p class=menu_level2><a href=>Hello world 2</a></p>

my css data:
..menu {
font-size:16px;
font-weight:bold;
background: white;
}

..menu_level2 {
font-size:16px;
font-weight:bold;
background: #AAE;
text-indent:15px;
}

These paragraps generates a empty line between each paragraphs, how can I
remove that double line?

Jeff
 
B

Barbara de Zoete

html code:
<p class=menu><a href=#>Hello world</a></p>
<p class=menu_level2><a href=>Hello world 2</a></p>

my css data:
.menu {
font-size:16px;
font-weight:bold;
background: white;
}

.menu_level2 {
font-size:16px;
font-weight:bold;
background: #AAE;
text-indent:15px;
}

These paragraps generates a empty line between each paragraphs, how can I
remove that double line?


You're trying to solve the wrong problem. Those paragraphs are no
paragraphs at all. By the looks of it, you want to create a list that
holds your navigation menu. Then create the list:

markup:

<ul id="menu">
<li><a href="hello_world.html">Hello world</a>
<ul>
<li><a href="hello_world2.html">Hello world_2</a></li>
<li>more level 2 items</li>
</ul></li>
<li>more ...</li>
<li>and more...</li>
</ul>

styles:

ul#menu, ul#menu li, ul#menu ul {
padding:0;
border:0;
margin:0; /* disposes of the space between the items */
list-style:none;
text-indent:none;
font-size:1em; /* don't use fixed sizes for fonts; google for reasons */
font-weight:bold;
color:black /* if you set one colour, set them all; again, google for
reasons */
background-color:white; }

ul#menu ul li {
background-color:#AAE;
text-indent:15px; }






--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
J

Jeff

Thanks, it works now

Jeff

Barbara de Zoete said:
You're trying to solve the wrong problem. Those paragraphs are no
paragraphs at all. By the looks of it, you want to create a list that
holds your navigation menu. Then create the list:

markup:

<ul id="menu">
<li><a href="hello_world.html">Hello world</a>
<ul>
<li><a href="hello_world2.html">Hello world_2</a></li>
<li>more level 2 items</li>
</ul></li>
<li>more ...</li>
<li>and more...</li>
</ul>

styles:

ul#menu, ul#menu li, ul#menu ul {
padding:0;
border:0;
margin:0; /* disposes of the space between the items */
list-style:none;
text-indent:none;
font-size:1em; /* don't use fixed sizes for fonts; google for reasons
*/
font-weight:bold;
color:black /* if you set one colour, set them all; again, google for
reasons */
background-color:white; }

ul#menu ul li {
background-color:#AAE;
text-indent:15px; }






--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
Joined
Mar 3, 2009
Messages
1
Reaction score
0
How I got rid of the white space.

If you have tried all the other suggestions without a result (like I did) try putting this:

* {
margin: 0;
padding: 0;
}

in your CSS file.

(thanks DeafNLoud)

Then use padding: bla bla bla bla; to define the spaces you want in-between H1, H2 and Paragraphs. See searchourworld.com for the results.

Hope that helps. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top