|
|
|
|
|
Search The Website |
|
Content:
|
|
CSS Tutorial |
|
CSS:
A cascading style sheet (CSS) is a Web page derived from multiple sources with a defined order of precedence where
the definitions of any style element conflict. The Cascading Style Sheet, level 1 (CSS1) recommendation from the World
Wide Web Consortium (W3C), which is implemented in the latest versions of the Netscape and Microsoft Web browsers,
specifies the possible style sheets or statements that may determine how a given element is presented in a Web page.
CSS gives more control over the appearance of a Web page to the page creator than to the browser designer or the viewer.
With CSS, the sources of style definition for a given document element are in this order of precedence:
|
|
What Browsers Support Media Queries?
:
|
|
CSS Examples |
| You may learn CSS by examples: CCS3 School |
| Example 1:
Change the background-colour if the document is smaller than 640 pixels wide
<head> <style> body { background-color: lightgreen; } @media screen and (max-width: 640px) { body { background-color: lightblue; } } </style> </head> <body> <p>Resize the browser window. When the width of this document is less than 640 pixels, the background-color is "lightblue", otherwise it is "lightgreen".</p> </body> |
Resize the browser window. When the width of this document is less than 640 pixels, the background-color is "lightblue", otherwise it is "lightgreen".
| Example 2: The visibility
property specifies whether or not an element is visible.:
<head> |
Resize the browser window. When the width of this document is less than 640 pixels, the background-color is "red" and opacity is "0.5", otherwise it is "lightred" and opacity is "1.0".
| Example 3: Set the opacity level
for a <div> element:
<head>
@media
screen and (max-width: 640px) { |
Resize the browser window. When the width of this document is less than 640 pixels, This is a "visible" heading, otherwise is an "invisible" heading. Notice that the invisible heading still takes up space.
| More Examples: (view HTML/CCS source code of
the following examples to to learn more about CSS).
4. Header Footer and data container
|
|
Useful Links |
CSSCoding HelpDevelopment Tools |
Collection of some of the most useful web development resourcesHere you will find carefully picked links to thebest tutorials, most useful references and official specifications of the most important web programming languages. Browse |
|
|