This is a discussion on Help with css please within the Website Design Forum forums, part of the Website Design & Development category; I have been learning css thonly thing i have a problem is if i say put a margin- left 50px ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| | #1 (permalink) |
| Newbie | I have been learning css thonly thing i have a problem is if i say put a margin- left 50px everything after it will be the same or less i tell it other, i thought it would just go back to hard left. here is the code i was playing with: Code: body {
background-image: url('images/Picture036.jpg')
}
span.highlight
{
background-color: yellow;
color: blue
}
p.center
{
text-align: center;
}
p.big
{
font-family: arial;
color: white;
font-size: 15pt;
}
p.dotted
{
font-size: small;
border-style: dotted;
border-style: inset;
}
p
{
font-family: sans-serif;
font-size: 36pt;
margin-left: 50px;
color: blue;
}
if you see the <p> has a margin 50px but so does the rest if i don't add something else in to correct it.is this just how it is or is there something wrong with my code. |
| | |
| | #2 (permalink) |
| Super Moderator | You're defining ALL paragraphs to have a left margin of 50px. If you need only some to have a margin, then I'd define a new class of lm50 with your margin and then use Code: <p class="lm50">text... </p> If you're doign it for layout, then you may want to wrap the desired items with Code: <div class="lm50"> <p>text</p> <p>text 2</p> </div>
__________________ Alex Monaghan - Monaghan Consultants Ltd Web hosting, ADSL, IT & Database consultancy Custom Web hosting on UK or USA servers using Linux (cPanel) or Windows (DotNetPanel) Mobile Phone Ringtones, Logos, Java Games & more |
| | |