테스트 사이트 - 개발 중인 베타 버전입니다

메누정렬과 좌우사이즈 채택완료

꾸리찬 8년 전 조회 3,361
상단에 메뉴가 사이즈에따라 크기가 정해져있는데 텍스트 사이즈에따라 좌우크기가 자동 조절됐으면합니다.<br />
어디를 수정해야될까요?<br />
#gnb {position:relative;margin: 0;float:right}<br />
#gnb:after {display:block;visibility:hidden;clear:both;content:&quot;&quot;}<br />
#gnb h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}<br />
#gnb_1dul {padding:0;zoom:1;}<br />
#gnb_1dul:after {display:block;visibility:hidden;clear:both;content:&quot;&quot;}<br />
.gnb_1dli {z-index:10;position:relative;float:left;width:130px;text-align:center;}<br />
a.gnb_1da {padding-right:0;display:inline-block;&amp;nbsp; text-overflow: ellipsis;&amp;nbsp; overflow: hidden;&amp;nbsp; white-space: nowrap;font-weight:bold;line-height:2.95em;text-decoration:none;color:#fff;height:55px;line-height:55px;display:block;font-size:1.17em}<br />
css입니다.
댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
8년 전

#gnb {position:relative;margin: 0;float:right} 
#gnb:after {display:block;visibility:hidden;clear:both;content:""} 
#gnb h2 {position:absolute;font-size:0;line-height:0;overflow:hidden} 
#gnb_1dul {padding:0;zoom:1;} 
#gnb_1dul:after {display:block;visibility:hidden;clear:both;content:""} 
.gnb_1dli {z-index:10;position:relative;float:left;width:130px;text-align:center;} 
a.gnb_1da {padding-right:0;display:inline-block;  text-overflow: ellipsis;  overflow: hidden;  white-space: nowrap;font-weight:bold;line-height:2.95em;text-decoration:none;color:#fff;height:55px;line-height:55px;display:block;font-size:1.17em}  

 

이렇게 하시면 되겠네요

#gnb {position:relative;margin-left: 10px;float:right;} //오른쪽정렬

#gnb:after {display:block;visibility:hidden;clear:both;content:""}

#gnb h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}

#gnb_1dul {padding:0;zoom:1;}

#gnb_1dul:after {display:block;visibility:hidden;clear:both;content:""}

.gnb_1dli {z-index:10;position:relative;float:left;padding-left:50px;text-align:center}//width:130px;크기삭제, 여백

a.gnb_1da {padding-right:10px;display:inline-block;  text-overflow: ellipsis;  overflow: hidden;  white-space: nowrap;font-weight:bold;line-height:2.95em;text-decoration:none;color:#000;height:55px;line-height:55px;display:block;font-size:1.37em}

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

s
sinbi Expert
8년 전

width:130px 부위를 제거 후, padding 값만으로 조절하시면 됩니다. 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인