Cascading Style Sheets - Part 2

Cascading Style Sheets - Part 2 - CGS 2585:...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CGS 2585: CSS – Part 2 Page 1 © Mark Llewellyn CGS 2585: Desktop/Internet Publishing Spring 2011 Cascading Style Sheets (CSS) – Part 2 Department of Electrical Engineering and Computer Science University of Central Florida Instructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cgs2585/spr2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CGS 2585: CSS – Part 2 Page 2 © Mark Llewellyn You might be wondering after reading the first part of the CSS notes and creating your first style sheets what to do if you need to assign more than one style to the same element. For example, suppose that you define the following style for the <p> element: p { color: red } If you define the <p> element like this, all paragraphs in your document will be formatted with red text. If you want some paragraphs to have black text, you’ll need to override the global styles with an inline style. This however can become quite tedious if many style changes are needed in a single document. The better solution is to use a class or id selector . CSS – Classes and IDs
Background image of page 2
CGS 2585: CSS – Part 2 Page 3 © Mark Llewellyn Class and id selectors are used to define styles in your document that are independent of elements. Classes can be used to define styles for any number of elements and for any number of occurrences of elements in a document. The id attribute occurs only once in a document, so it should not be used to declare styles for a number of elements. For example, if you know that a certain element in a document
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/16/2011 for the course CGS 2585 taught by Professor Llewellyn during the Spring '11 term at University of Central Florida.

Page1 / 20

Cascading Style Sheets - Part 2 - CGS 2585:...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online