Jump to content

CSS Question


Phustus

Recommended Posts

I don't understand this part of the CSS tutorial (http://www.w3schools.com/css/css_syntax.asp is the url that has the info I can't understand). I don't know how to quote stuff so I'm just copying and pasting it:The id SelectorYou can also define styles for HTML elements with the id selector. The id selector is defined as a #.The style rule below will match the element that has an id attribute with a value of "green":#green {color: green}The style rule below will match the p element that has an id with a value of "para1":P#para1{text-align: center;color: red}Was this id Selector in the HTML tutorial or something because I can't remember :) please help.

Link to comment
Share on other sites

Hi phustus,I could'nt seem to find the usage of 'id' in the tutorials either, but i only attempted a small search.But here's how you would use your example:

/* this is a comment -- tester.css */#green{color:green}p#para1{text-align: center;color: red}

<html><body><head><link rel="stylesheet" type="text/css" href="tester.css" /></head><h1 id="green">Hello from inside h1, this header is green</h1><p id="para1">hello from inside the paragraph, which is centered and red</p></body><html>

hope this helps.Also you can code fragements by using the buttons in the edit toolbar above where you type out your question. The button for code is labeled '#', press it twice and two code boxes will appear '


'in you space for typing. Place your code between these two boxes.

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...