Jump to content

External style sheets - use of


tytwp

Recommended Posts

HiAs a complete newbie to it, I'm trying to work through the W3Schools CSS tutorials but am confused, is it possible to have a multi page left margin setting in an external style sheet ?The Tutorial only appears to have the html coding below - which works fine on single pagesIf the answer is no, am I missing something very basic regarding the use of ext style sheets ?<html><head><style type="text/css">p.leftmargin {margin-left: 2cm}</style></head><body><p>This is a paragraph with no margin specified</p><p class="leftmargin">This is a paragraph with a specified left margin</p></body></html>

Link to comment
Share on other sites

I dont think that it is suppose to be 2cm. try this code-

<html><head><style type="text/css">p.leftmargin {margin-left: 2px}</style></head><body><p>This is a paragraph with no margin specified</p><p class="leftmargin">This is a paragraph with a specified left margin</p></body></html>

Tryit Editor<html><head><style type="text/css">p.leftmargin {margin-left: 2px;}</style></head><body><p>This is a paragraph with no margin specified</p><p class="leftmargin">This is a paragraph with a specified left margin</p></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...