国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

HTML+CSS Easy to Get Started with Inline Block Elements

Inline-block elements have the characteristics of both inline elements and block elements

So how to set elements as inline block elements

display:inline-block;

Note: (new in css2.1), <img>, <input> tags are such inline block tags.

Characteristics of inline block elements


1, and other elements are on the same line;

2 , the element's height, width, line height, and top and bottom margins can all be set.

Let’s write an example below to set the width, height, background color, etc. for an a tag. The a tag is an inline element by default, and the width and height have no effect.

The code is as follows:

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
	a{
		display:inline-block;	/*內(nèi)聯(lián)塊狀元素*/	
		width:300px;
		height:200px;
		background-color:green;
		color:red;
	}
</style>
</head>
<body>
  	<a href="#">歡迎大家來到php中文網(wǎng)</a>
</body>
</html>

As shown in the above code, when we convert the a tag into an inline block element, we can set the width and height

Continuing Learning
||
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> a{ display:inline-block; /*內(nèi)聯(lián)塊狀元素*/ width:300px; height:200px; background-color:green; color:red; } </style> </head> <body> <a href="#">歡迎大家來到php中文網(wǎng)</a> </body> </html>
submitReset Code