Examples
Category: .CSS Basics
CSS Combinators
‘ ‘ (descendant selector) > (child selector) + (adjacent sibling selector) Select an element that is directly after another specific element. ~ (general sibling selector)
Adding styles within an html File
Adding named styles Adding inline styles
Class and ID names
Apply a style to all elements Multiple Class Names Apply style to different classes Comma seperate them Apply style to elements which have all the specified classes (Note there is NO comma between them)
Adding a .css stylesheet (default stylesheet)
In your html / php file add this (The old type=”text/css” is no longer required) Create your styles.css file An example with a good main stylesheet default content
.CSS General
DIV vs SPAN DIV’s cause a new line. To change the stule of text min line use SPAN Using Div’s Without A Style <div style=”margin-top: 10px;”> ‘.’ or ‘# # is for ID You use ‘#somename’ when its an <div id=”somename” ID’s can be useful to suround an area so that you can use this […]