Harvard Extension School, Fall 2018
CSCI E-12 Fundamentals of Web Site Development

## id selectors

id names are referenced in CSS as `#idref`, and may or may not have an element name preceding the period (`#idref` or `element#idref`.

Example 3.34 - id selectors - Example 3.34 (Without Styles) | <div id="header"> put in header information here </div><div id="main"><!-- main content --> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras sollicitudin, orci nec facilisis vehicula, neque urna porta risus, ut sagittis enim velit at orci. Fusce velit. Integer sapien enim, rhoncus vitae, cursus non, commodo vitae, felis. Nulla convallis ante sit amet urna. Maecenas condimentum hendrerit turpis. </div><div id="footer"> put in footer information here </div> #main { background-color: blue; color: white; border-color: green; border-width: thick; border-style: solid; }

- Markup
- Style
- Screenshot

     <div id="header">put in header information here</div><div id="main"><!-- main content -->Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras sollicitudin, orci nec facilisis vehicula, neque urna porta risus, ut sagittis enim velit at orci. Fusce velit. Integer sapien enim, rhoncus vitae, cursus non, commodo vitae, felis. Nulla convallis ante sit amet urna. Maecenas condimentum hendrerit turpis.</div><div id="footer">put in footer information here</div>

In `style` element (`<style type="text/css">`) within `head` element:

        #main {
                background-color: blue;
                color: white;
                border-color: green;
                border-width: thick;
                border-style: solid;
        }

Copyright © David Heitmeyer