Home > Web Front-end > HTML Tutorial > Ask God for advice! Thank you_html/css_WEB-ITnose

Ask God for advice! Thank you_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-24 11:59:08
Original
1280 people have browsed it


Reply to discussion (solution)

Wouldn’t it be enough to just add an ID to the first one?
#column1
{
Width:200px;
}

Can’t we just add an ID to the first one?
#column1
{
width:200px;
}



Thanks. . . It was an epiphany all of a sudden. . . . I actually want to set 3 different widths in one class. . . So short-sighted. . . .

1, 2, 3; the content of the floor

can generate 3 stories

using CSS :first-child selector

1 , 2, 3; the content of the floor

can generate 3 stories



Alas. . . ACCIDENT! ! ! ! However, how to make the last two divs the same width~~~~The front is still a fixed value of 200px~

Use CSS :first-child selector



Yes, yes. . . . hey-hey. . . .

<style type="text/css">	.box{		width:100%;		height:100px;		background-color:#CCC;		/*定义和盒模型*/		display:-webkit-box;		}	.item{		margin:3px;		background-color:#999;		/*3列栏目为一个整体盒布局效果*/		box-sizing:border-box;		}	.item:nth-child(1){				width:200px;				}		.item:nth-child(2){		/*自适应大小*/		-webkit-box-flex:1;				}	.item:nth-child(3){		/*自适应大小*/		-webkit-box-flex:1;	}</style>
Copy after login


That’s it~

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Why can't the list be rendered?
From 1970-01-01 08:00:00
0
0
0
HTML summary
From 1970-01-01 08:00:00
0
0
0
HTML summary
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template