-
실전에서 유용하게 쓰이는 CSS 코드 -2-Front-End 2013. 6. 6. 15:57
/*여백조절*/
body{ margin:0; padding:0} /*여백 설정을 0으로 하려면 마진과 패딩 둘다 0으로 지정*/
body { margin:20px; padding:0; background-color:silver;}
/*중앙 정렬*/
#body{ margin:0 auto;}
body{ margin:0 auto; text-align:center;}/*IE 6의 중앙정렬을 위해선 text-align 을지정*/
/* 글로벌 네비게이션 */
ul#globalnavi{ margin:0; padding:0;}
ul#globalnavi li{ display:inline; list-style-type:none; margin:0; padding:5px; font-size:80%;}
ul#globalnavi a{ font-weight:bold; color:#699; text-decoration:none;}
/* curser style hover and active*/
ul#globalnavi a:hover,ul#globalnavi a:active{ border-bottom:2px solid #900; color:#900;}
/* 제목글의 시선*/
h1{ padding:8px; color:white; background-color:#699; font-size:1.2em;}
h2{ padding:8px; color:#699; border-top:1px dotted #699;border-bottom:1px dotted #699;border-left:10px solid #699;}
/*form*/
<form>
<dl>
<dt><label for="name">名前</label></dt>
<dd><input type="text" size="50" name="name" id="name" value=""/></dd>
<dt><label for="email"><E-mail</label></dt>
<dd><input type="text" size="50" name="email" id="email" value=""/></dd>
<dt><label for="url">URL</label></dt>
<dd><textarea name="comment" id="comment" rows="7" cols="50">texttexttext</textarea></dd>
<dd><input type="submit" name="submit" id="submit" value="send"/></dd>
</dl>
</form>
dt{ padding-left:8px; border-left:8px solid #9cc;}
dd{ margin:5px 0 10px;}
/*fieldest and legend*/
fieldset{ padding:20px; border:1px solid gray;}
legend{ border-right:1px solid gray; border-bottom:1px solid gray; font-weight:bold;}
<form>
<fieldset>
<legend>title</legend>
</fieldset>
</form>
/*looks like table -dl*/
dt{display:block; float:left; clear:left; width:50px; margin:0 10px 4px 0; padding:0; border:0; font-size:90%; font-weight:normal; text-align:right;}
dd{ margin:0 0 8px;}
input#submit{ margin-left:60px;}
fieldset{ padding:20px; border:1px solid gray; background-color:#699; color:white;}
legend{ border-top:1px solid gray; border-right:1px solid gray; border-left: 1px solid gray; background-color:#699; font-weight:bold;}
.border{ width:80%; padding:3px; border:1px solid silver;}
추가로 css 파일 2개 첨부 합니다
'Front-End' 카테고리의 다른 글
SCSS (0) 2019.06.13 스마트폰에서 pre 문자 자동 단락조절 CSS (0) 2014.05.01 html5 요소 + IE핵 (2) 2013.06.13 CSS 폰트사이즈 정리 (1) 2013.06.06 실전에서 유용하게 쓰이는 CSS 코드 -1- (1) 2013.06.06