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