HTML Inline element tags

Source: Internet
Author: User

Element classification--inline elements

,<span>, <a>, <label>, <strong>, and <em> are typical inline elements in HTML (inline elements ) (inline) element. Of course, block elements can also display:inline be coded to set elements as inline elements . The code below is to convert the block element div into an inline element , so that the DIV element has an inline element feature.

div{     Display:inline;} ......<div> I want to become an inline element </div>

Inline element Features:

1, and other elements are on one line;

2, the height of the element , the width and the top and bottom margin is not set;

3. The width of the element is the width of the text or Picture it contains, and it cannot be changed.

Small friends you look at the right side of the code snippet, there is no problem, there is a gap between the inline elements, the problem is described in this section of the wiki, interested in the small partners can go to see.

<! DOCTYPE html>


<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Inline Element Tags </title>
<style type= "Text/css" >
a,span,em{
background:pink;/* set A, span, EM label background color is pink */
}
</style>

<body>
<a href= "http://www.baidu.com" > Baidu </a>
<a href= "http://www.imooc.com" > Mu class network </a>
<span>33333</span>
<span>44444</span><em>555555</em>
</body>

HTML Inline element tags

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.