📄 css_intro.asp@output=print
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Introduction</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />
<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</head>
<body>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
<h1>Introduction to CSS</h1>
<a href="default.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="css_syntax.asp"><img border="0" src="../images/btn_next.gif" width="100" height="20" alt="Next" /></a>
<hr />
<h2>What You Should Already Know</h2>
<p>Before you continue you should have some basic understanding of the
following:</p>
<ul>
<li>HTML / XHTML</li>
</ul>
<p>If you want to study this subject first, find the tutorials on our
<a target="_top" href="../default.asp">Home page</a>.</p>
<hr />
<h2>What is CSS?</h2>
<ul>
<li><b>CSS</b> stands for <b>C</b>ascading <b>S</b>tyle <b>S</b>heets</li>
<li>Styles define <b> how to display</b> HTML elements</li>
<li>Styles are normally stored in <b>Style Sheets</b> </li>
<li>Styles were added to HTML 4.0 <b>to solve a problem</b></li>
<li><b>External Style Sheets</b> can save you a lot of work</li>
<li>External Style Sheets are stored in <b>CSS files</b></li>
<li>Multiple style definitions will <b>cascade</b> into one</li>
</ul>
<hr />
<h2>CSS Demo</h2>
<p>With CSS, your HTML documents can be displayed using different output styles:</p>
<p> <a href="demo_default.htm" target="_blank">See how it works</a></p>
<hr />
<h2>Styles Solve a Common Problem</h2>
<p>HTML tags were originally designed to define the content of a document. They
were supposed to say "This is a header", "This is a
paragraph", "This is a table", by using tags like <h1>,
<p>, <table>, and so on. The layout of the document was supposed to
be taken care of by the browser, without using any formatting tags.</p>
<p>As the two major browsers - Netscape and Internet Explorer -
continued to add new HTML tags and attributes (like the <font> tag and the
color attribute) to the original HTML specification, it became
more and more difficult to create Web sites where the content of HTML
documents was clearly separated from the document's presentation
layout.</p>
<p>To solve this problem, the World Wide Web Consortium (W3C) - the non profit,
standard setting consortium, responsible for standardizing HTML - created STYLES
in addition to HTML 4.0. </p>
<p>
All major browsers support Cascading Style Sheets.</p>
<hr />
<h2>Style Sheets Can Save a Lot of Work</h2>
<p>Styles sheets define HOW HTML elements are to be displayed, just like the
font tag and the color attribute in HTML 3.2. Styles are normally saved in
external .css files. External style sheets enable you to change the
appearance and layout
of all the pages in your Web, just
by editing one single CSS document!</p>
<p>CSS is a breakthrough in Web design
because it allows developers to control the style and layout of multiple Web pages all at once.
As a Web developer you can define a style for each HTML element and apply it to as
many Web pages as you want. To make a global change, simply
change the style, and all elements in the Web are updated automatically. </p>
<hr />
<h2>Multiple Styles Will Cascade Into One</h2>
<p>Style sheets allow style information to be specified in many ways. Styles can
be specified inside a single HTML element, inside the <head> element of an
HTML page, or in an external CSS file. Even multiple external style sheets can be referenced
inside a single HTML document.
</p>
<h3> Cascading Order</h3>
<p> <b>What style will be used when there is more than one style specified for
an HTML element?<br />
</b>
<br />
Generally speaking we can say that all the styles will "cascade" into
a new "virtual" style sheet by the following rules, where number four
has the highest priority:
</p>
<ol>
<li>Browser default</li>
<li>External style sheet</li>
<li>Internal style sheet (inside the <head> tag)</li>
<li>Inline style (inside an HTML element)</li>
</ol>
<p>So, an inline style (inside an HTML element) has the highest priority, which
means that it will override a style declared inside the <head> tag, in
an external style sheet, or in a browser (a default value).</p>
<hr />
<a href="default.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="css_syntax.asp"><img border="0" src="../images/btn_next.gif" width="100" height="20" alt="Next" /></a>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -