CSS and HTML (span) __html

Source: Internet
Author: User

1. An external style sheet cannot contain any HTML tags such as <HEAD> or <STYLE>

2, the Rel property is used to define the relationship between the connected file and the HTML document. REL=STYLESHEET specifies a fixed or preferred style and rel= "Alternate StyleSheet" to define an interaction style. Fixed styles are always applied when the style sheet is active. The missing title attribute, defining a fixed style.

3, <link rel=stylesheet href= "Basics.css" title= "contemporary" >
<link rel=stylesheet href= "Tables.css" title= "contemporary" >
<link rel=stylesheet href= "Forms.css" title= "contemporary" >
In this example, three style sheets are grouped together into a "contemporary" style, which is applied as a preferred style sheet. To combine multiple style sheets into a single style, you must use the same title in each style sheet.

4, the Type property is used to specify the media type, and the link element is the same.   Similarly, the title and media properties can also be specified with the style. <style type= "Text/css" media=screen>

5. Punk {color:lime; Background: #ff80c0}
p.warning {font-weight:bolder;   color:red; Background:white}

In this example, the punk class can be used with any BODY element because it has no HTML element association in the style sheet. In the case of the stylesheet, the warning class can only be used for P elements.

6. The span element is added to the HTML to allow the Web page creator to give the style but no need to attach to an HTML structural element. span is used as a selector in a style sheet, and it can accept style, class, and ID attributes.

span is an inline element, so it can be used as an element in HTML, such as EM and strong. The most important difference is that although EM and strong have structural meanings, span does not have the same meaning. Its existence is purely an application style, so it has no effect when the stylesheet is invalidated.

Some span examples are as follows:

      <! doctype   html   public   "-//w3c//dtd   HTML   4.0//EN" >  
  <HTML> 
  <HEAD> 
  <title>span Example </TITLE>  
  <STYLE   type= "text/css"    media= "screen,   print,   Projection "> 
  <!-- 
      .firstwords   {    font-variant:   small-caps  } 
 --> 
  </STYLE>  
  </HEAD> 
  <BODY> 
  <P><SPAN   class= firstwords>the   first   few   words</span> is preceded by a handful of text in a paragraph, which is a small capital letter. Styles can also be inline, such as changing the text style to <SPAN   style= "font-family:arial" >Arial</SPAN>.</P>

The

    span usage is similar to a div except that the div is block-level, and span can be said to be line-level (as the teacher says).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.