Last active
March 30, 2016 02:47
-
-
Save dongyuwei/781ad22d8625ee2982f1d8b246689bcb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>test css</title> | |
<meta charset="utf-8"/> | |
<style> | |
.line { | |
overflow: hidden; | |
width: 50%; | |
} | |
.line .item { | |
float: left; | |
width: 25%; | |
margin-bottom: 10px; | |
} | |
.line .item .txt{ | |
overflow: hidden; | |
display: block; | |
} | |
.left{ | |
float: left; | |
} | |
/*table table-cell width calc() */ | |
</style> | |
</head> | |
<body> | |
<div class="line"> | |
<div class="item"> | |
<span class='left'> | |
<input type="radio"/> | |
<span> A. </span> | |
</span> | |
<span class="txt">西安智园软件开发管理有限公司</span> | |
</div> | |
<div class="item"> | |
<span class='left'> | |
<input type="radio"/> | |
<span> A. </span> | |
</span> | |
<span class="txt">西安智园软件开发管理有限公司</span> | |
</div> | |
<div class="item"> | |
<span class='left'> | |
<input type="radio"/> | |
<span> A. </span> | |
</span> | |
<span class="txt">西安智园软件开发管理有限公司</span> | |
</div> | |
<div class="item"> | |
<span class='left'> | |
<input type="radio"/> | |
<span> A. </span> | |
</span> | |
<span class="txt">西安智园软件开发管理有限公司</span> | |
</div> | |
<div class="item"> | |
<span class='left'> | |
<input type="radio"/> | |
<span> A. </span> | |
</span> | |
<span class="txt">西安智园软件开发管理有限公司</span> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
table + table-cell + calc() can resolve the layout problem; but I prefer to apply the media-object pattern. simple and powerful.
. item's width is responsive, thus the .txt's width is responsive, too.