Ask God for advice! Thank you_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:59:08
Original
1214 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:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template