What's wrong with this code?

  • bgraybr
  • Novice
  • Novice
  • bgraybr
  • Posts: 26

Post 3+ Months Ago

I'm using a CSS style sheet:

Code: [ Select ]
p3 {text-align: center; font-family= times; font-size: small}


When I use this code it does everything but center align, I've ckecked everything but can't find my error.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

there shouldn't be an = it should be a : then it should all work also put a ; after small. also what is p3? a class? an ID? if its a class it needs to start with a period (.p3) if its an ID it needs to start with a pound sign (#p3)
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

graphixboy this is a hash #
and this is a pound sign £!
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Your right me and my americanisms...
  • bgraybr
  • Novice
  • Novice
  • bgraybr
  • Posts: 26

Post 3+ Months Ago

graphixboy wrote:
there shouldn't be an = it should be a : then it should all work also put a ; after small. also what is p3? a class? an ID? if its a class it needs to start with a period (.p3) if its an ID it needs to start with a pound sign (#p3)


Well here's the entire code:

Code: [ Select ]
h1 {font-family: arial; font-size: 130%}
h2 {font-family: arial; font-size: 95%}
p {border: inset; font-family= courier; padding: 0.2cm 0.2cm}
p2 {text-indent: 1cm; font-family= times}
p3 {text-align: center; font-family= times; font-size: small}
a:link {color: black}
a:visited {color: black}
a:hover {color: black}
a:active {color: black}
  1. h1 {font-family: arial; font-size: 130%}
  2. h2 {font-family: arial; font-size: 95%}
  3. p {border: inset; font-family= courier; padding: 0.2cm 0.2cm}
  4. p2 {text-indent: 1cm; font-family= times}
  5. p3 {text-align: center; font-family= times; font-size: small}
  6. a:link {color: black}
  7. a:visited {color: black}
  8. a:hover {color: black}
  9. a:active {color: black}


Have I been doing the whole thing wrong? All of the others worked fine.
Moderator Remark: added code tags
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

It may work in some places but the code is not correct. ALL CSS should be in this format
Code: [ Select ]
item{
property1:value;
property2:value;
}
  1. item{
  2. property1:value;
  3. property2:value;
  4. }
where a colon separates the property (font-size) from a value (12px)

Correcting the syntax will likely fix a lot of other problems.
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

Code: [ Select ]
h1 {font-family:arial; font-size:130%}
h2 {font-family:arial; font-size:95%}
p {border:inset; font-family:courier; padding:0.2cm}
p2 {text-indent:1cm; font-family:times}
p3 {text-align:center; font-family:times; font-size:small}
a:link {color: black}
a:visited {color:black}
a:hover {color:black}
a:active {color:black}
  1. h1 {font-family:arial; font-size:130%}
  2. h2 {font-family:arial; font-size:95%}
  3. p {border:inset; font-family:courier; padding:0.2cm}
  4. p2 {text-indent:1cm; font-family:times}
  5. p3 {text-align:center; font-family:times; font-size:small}
  6. a:link {color: black}
  7. a:visited {color:black}
  8. a:hover {color:black}
  9. a:active {color:black}

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 45 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.