너비에 맞춰 게시판 좌우 글자수 자르는 스타일에 대해 질문드려요

너비에 맞춰 게시판 좌우 글자수 자르는 스타일에 대해 질문드려요

QA

너비에 맞춰 게시판 좌우 글자수 자르는 스타일에 대해 질문드려요

본문

셀마다 width 설정이 안되어 있어서 그런것같은데

 

.bo_tit {text-overflow:ellipsis; overflow:hidden; white-space:nowrap}

 

추가했더니 제목이 테이블을 아예 밀고 나가서 너비를 더 벌려버리더라고요

 

display:inline-block; 이걸 활용해보라는 분도 계시는데

 

일단 병행했을때 별다른 반응이 없네요

 

팁게에 유동 Width 의 경우에도 알아서 잘라준다는 css글을 참고하여 리스트 스킨에

 

<div class="bo_tit" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 90%; display: block;">

 

로 스타일을 줘봐도 똑같은 현상입니다 ㅠㅠ

 

 

스킨 style.css 는 아래와 같은 설정인데

 

혹시 이 상태에서 글자수가 자동으로 잘리는 괜찮은 방법이 있으면 조언부탁드립니다 ㅠㅠ

 

 

 

 

/* ### 기본 스타일 커스터마이징 시작 ### */

/* 게시판 버튼 */
.notice_div { font-weight:normal;overflow:hidden;color:#000000;font-weight:bold; border:none}
/* 목록 버튼 */
#bo_list a.btn_b01 {}
#bo_list a.btn_b01:focus, #bo_list a.btn_b01:hover {}
#bo_list a.btn_b02 {}
#bo_list a.btn_b02:focus, #bo_list a.btn_b02:hover {}
#bo_list a.btn_admin {} /* 관리자 전용 버튼 */
#bo_list a.btn_admin:focus, #bo_list .btn_admin:hover {}

/* 읽기 버튼 */
#bo_v a.btn_b01 {}
#bo_v a.btn_b01:focus, #bo_v a.btn_b01:hover {}
#bo_v a.btn_b02 {}
#bo_v a.btn_b02:focus, #bo_v a.btn_b02:hover {}
#bo_v a.btn_admin {} /* 관리자 전용 버튼 */
#bo_v a.btn_admin:focus, #bo_v a.btn_admin:hover {}

/* 쓰기 버튼 */
#bo_w .btn_confirm {} /* 서식단계 진행 */
#bo_w .btn_submit {}
#bo_w button.btn_submit {}
#bo_w fieldset .btn_submit {}
#bo_w .btn_cancel {}
#bo_w button.btn_cancel {}
#bo_w .btn_cancel:focus, #bo_w .btn_cancel:hover {}
#bo_w a.btn_frmline, #bo_w button.btn_frmline {} /* 우편번호검색버튼 등 */
#bo_w button.btn_frmline {}

/* 기본 테이블 */
/* 목록 테이블 */
#bo_list .tbl_head01 {}
#bo_list .tbl_head01 caption {}
#bo_list .tbl_head01 thead th {}
#bo_list .tbl_head01 thead a {}
#bo_list .tbl_head01 thead th input {} /* middle 로 하면 게시판 읽기에서 목록 사용시 체크박스 라인 깨짐 */
#bo_list .tbl_head01 tfoot th {}
#bo_list .tbl_head01 tfoot td {}
#bo_list .tbl_head01 tbody th {}
#bo_list .tbl_head01 td {}
    font-size: 11px; 
}
#bo_list .tbl_head01 a {}
#bo_list td.empty_table {}

/* 읽기 내 테이블 */
#bo_v .tbl_head01 {}
#bo_v .tbl_head01 caption {}
#bo_v .tbl_head01 thead th {}
#bo_v .tbl_head01 thead a {}
#bo_v .tbl_head01 thead th input {} /* middle 로 하면 게시판 읽기에서 목록 사용시 체크박스 라인 깨짐 */
#bo_v .tbl_head01 tfoot th {}
#bo_v .tbl_head01 tfoot td {}
#bo_v .tbl_head01 tbody th {}
#bo_v .tbl_head01 td {}
#bo_v .tbl_head01 a {}
#bo_v td.empty_table {}

/* 쓰기 테이블 */
#bo_w table {}
#bo_w caption {}
#bo_w .frm_info {}
#bo_w .frm_address {}
#bo_w .frm_file {}

#bo_w .tbl_frm01 {}
#bo_w .tbl_frm01 th {}
#bo_w .tbl_frm01 td {}
#bo_w .tbl_frm01 textarea, #bo_w tbl_frm01 .frm_input {}
#bo_w .tbl_frm01 textarea {}
/*
#bo_w .tbl_frm01 #captcha {}
#bo_w .tbl_frm01 #captcha input {}
*/
#bo_w .tbl_frm01 a {}

/* 필수입력 */
#bo_w .required, #bo_w textarea.required {}

#bo_w .cke_sc {}
#bo_w button.btn_cke_sc{}
#bo_w .cke_sc_def {}
#bo_w .cke_sc_def dl {}
#bo_w .cke_sc_def dl:after {}
#bo_w .cke_sc_def dt, #bo_w .cke_sc_def dd {}
#bo_w .cke_sc_def dt {}
#bo_w .cke_sc_def dd {}

/* ### 기본 스타일 커스터마이징 끝 ### */

/* 게시판 목록 */
#bo_list .td_board {width:120px;text-align:center}
#bo_list .td_chk {width:30px;text-align:center}
#bo_list .td_date {width:60px;text-align:center}
#bo_list .td_datetime {width:110px;text-align:center}
#bo_list .td_group {width:100px;text-align:center}
#bo_list .td_mb_id {width:100px;text-align:center}
#bo_list .td_mng {width:80px;text-align:center}
#bo_list .td_name {width:100px;text-align:left}
#bo_list .td_nick {width:100px;text-align:center}
#bo_list .td_num {width:50px;text-align:center}
#bo_list .td_numbig {width:80px;text-align:center}

#bo_list .txt_active {color:#5d910b}
#bo_list .txt_expired {color:#ccc}

#bo_cate h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_cate ul {margin-bottom:10px;padding-left:1px;zoom:1}
#bo_cate ul:after {display:block;visibility:hidden;clear:both;content:""}
#bo_cate li {float:left;margin-bottom:-1px}
#bo_cate a {display:block;position:relative;margin-left:-1px;padding:6px 0 5px;width:90px;border:1px solid #ddd;background:#f7f7f7;color:#888;text-align:center;letter-spacing:-0.1em;line-height:1.2em;cursor:pointer}
#bo_cate a:focus, #bo_cate a:hover, #bo_cate a:active {text-decoration:none}
#bo_cate #bo_cate_on {z-index:2;border:1px solid #565e60;background:#fff;color:#565e60;font-weight:bold}

.td_subject img {margin-left:3px}

/* 게시판 목록 공통 */
.bo_fx {margin-bottom:5px;zoom:1}
.bo_fx:after {display:block;visibility:hidden;clear:both;content:""}
.bo_fx ul {margin:0;padding:0;list-style:none}
#bo_list_total {float:left;padding-top:5px}
.btn_bo_user {float:right;margin:0;padding:0;list-style:none}
.btn_bo_user li {float:right;margin-left:5px}
.btn_bo_adm {float:left}
.btn_bo_adm li {float:left;margin-right:5px}
.btn_bo_adm input {padding:8px;border:0;background:#e8180c;color:#fff;text-decoration:none;vertical-align:middle}
.bo_notice td {background:#f5f6fa}
.bo_notice td a {font-weight:bold}
.td_num strong {color:#000}
.bo_cate_link {display:inline-block;margin:0 3px 0 0;padding:0 6px 0 0;border-right:1px solid #e7f1ed;color:#999 !important;font-weight:bold;text-decoration:none} /* 글제목줄 분류스타일 */
.bo_current {color:#e8180c}
#bo_list .cnt_cmt {display:inline-block;margin:0 0 0 3px;font-weight:bold}

#bo_sch {margin-bottom:10px;padding-top:5px;text-align:center}
#bo_sch legend {position:absolute;margin:0;padding:0;font-size:0;line-height:0;text-indent:-9999em;overflow:hidden}

.bo_tit {text-overflow:ellipsis; overflow:hidden; white-space:nowrap} /* 글자수 조절을 위해 추가 */

/* 게시판 쓰기 */
#char_count_desc {display:block;margin:0 0 5px;padding:0}
#char_count_wrap {margin:5px 0 0;text-align:right}
#char_count {font-weight:bold}

#autosave_wrapper {position:relative}
#autosave_pop {display:none;z-index:10;position:absolute;top:24px;right:117px;padding:8px;width:350px;height:auto !important;height:180px;max-height:180px;border:1px solid #565656;background:#fff;overflow-y:scroll}
html.no-overflowscrolling #autosave_pop {height:auto;max-height:10000px !important} /* overflow 미지원 기기 대응 */
#autosave_pop strong {position:absolute;font-size:0;line-height:0;overflow:hidden}
#autosave_pop div {text-align:right}
#autosave_pop button {margin:0;padding:0;border:0;background:transparent}
#autosave_pop ul {margin:10px 0;padding:0;border-top:1px solid #e9e9e9;list-style:none}
#autosave_pop li {padding:8px 5px;border-bottom:1px solid #e9e9e9;zoom:1}
#autosave_pop li:after {display:block;visibility:hidden;clear:both;content:""}
#autosave_pop a {display:block;float:left}
#autosave_pop span {display:block;float:right}
.autosave_close {cursor:pointer}
.autosave_content {display:none}

/* 게시판 읽기 */
#bo_v {margin-bottom:20px;padding-bottom:20px}

#bo_v_table {position:absolute;top:0;right:16px;margin:0;padding:0 5px;height:25px;background:#ff3061;color:#fff;font-weight:bold;line-height:2.2em}

#bo_v_title {padding:10px 0;font-size:1.2em}

#bo_v_info {padding:0 0 10px;border-bottom:1px solid #ddd}
#bo_v_info h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_v_info strong {display:inline-block;margin:0 15px 0 5px;font-weight:normal}
#bo_v_info .sv_member,
#bo_v_info .sv_guest,
#bo_v_info .member,
#bo_v_info .guest {font-weight:bold}

#bo_v_file {}
#bo_v_file h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_v_file ul {margin:0;padding:0;list-style:none}
#bo_v_file li {padding:0 10px;border-bottom:1px solid #eee;background:#f5f6fa}
#bo_v_file a {display:inline-block;padding:8px 0 7px;width:100%;color:#000;word-wrap:break-word}
#bo_v_file a:focus, #bo_v_file a:hover, #bo_v_file a:active {text-decoration:none}
#bo_v_file img {float:left;margin:0 10px 0 0}
.bo_v_file_cnt {display:inline-block;margin:0 0 3px 16px}

#bo_v_link {}
#bo_v_link h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_v_link ul {margin:0;padding:0;list-style:none}
#bo_v_link li {padding:0 10px;border-bottom:1px solid #eee;background:#f5f6fa}
#bo_v_link a {display:inline-block;padding:8px 0 7px;width:100%;color:#000;word-wrap:break-word}
#bo_v_link a:focus, #bo_v_link a:hover, #bo_v_link a:active {text-decoration:none}
.bo_v_link_cnt {display:inline-block;margin:0 0 3px 16px}

#bo_v_top {margin:0 0 10px;padding:10px 0;zoom:1}
#bo_v_top:after {display:block;visibility:hidden;clear:both;content:""}
#bo_v_top h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_v_top ul {margin:0;padding:0;list-style:none}

#bo_v_bot {zoom:1}
#bo_v_bot:after {display:block;visibility:hidden;clear:both;content:""}
#bo_v_bot h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_v_bot ul {margin:0;padding:0;list-style:none}

.bo_v_nb {float:left}
.bo_v_nb li {float:left;margin-right:5px}
.bo_v_com {float:right}
.bo_v_com li {float:left;margin-left:5px}

#bo_v_atc {min-height:200px;height:auto !important;height:200px}
#bo_v_atc_title {position:absolute;font-size:0;line-height:0;overflow:hidden}

#bo_v_img {margin:0 0 10px;width:100%;overflow:hidden;zoom:1}
#bo_v_img:after {display:block;visibility:hidden;clear:both;content:""}
#bo_v_img img {margin-bottom:20px;max-width:100%;height:auto}

#bo_v_con {margin-bottom:30px;width:100%;line-height:1.7em;word-break:break-all;overflow:hidden}
#bo_v_con a {color:#000;text-decoration:underline}
#bo_v_con img {max-width:100%;height:auto}

#bo_v_act {margin-bottom:30px;text-align:center}
#bo_v_act .bo_v_act_gng {position:relative}
#bo_v_act a {margin-right:5px;vertical-align:middle}
#bo_v_act strong {color:#ff3061}
#bo_v_act_good, #bo_v_act_nogood {display:none;position:absolute;top:30px;left:0;padding:10px 0;width:165px;background:#ff3061;color:#fff;text-align:center}

#bo_v_sns {margin:0 0 20px;padding:0;list-style:none;zoom:1}
#bo_v_sns:after {display:block;visibility:hidden;clear:both;content:""}
#bo_v_sns li {float:left;margin:0 5px 0 0}

/* 게시판 댓글 */
#bo_vc {margin:0 0 20px;padding:20px 20px 10px;border:1px solid #e5e8ec;background:#f5f8f9}
#bo_vc h2 {margin-bottom:10px}
#bo_vc article {padding:0 0 10px;border-top:1px dotted #ccc}
#bo_vc header {position:relative;padding:15px 0 5px}
#bo_vc header .icon_reply {position:absolute;top:15px;left:-20px}
#bo_vc .sv_wrap {margin-right:15px}
#bo_vc .member, #bo_vc .guest, #bo_vc .sv_member, #bo_vc .sv_guest {font-weight:bold}
.bo_vc_hdinfo {display:inline-block;margin:0 15px 0 5px}
#bo_vc h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_vc a {color:#000;text-decoration:none}
#bo_vc p {padding:0 0 5px;line-height:1.8em}
#bo_vc p a {text-decoration:underline}
#bo_vc p a.s_cmt {text-decoration:none}
#bo_vc_empty {margin:0;padding:20px !important;text-align:center}
#bo_vc #bo_vc_winfo {float:left}
#bo_vc footer {zoom:1}
#bo_vc footer:after {display:block;visibility:hidden;clear:both;content:""}

.bo_vc_act {float:right;margin:0;list-style:none;zoom:1}
.bo_vc_act:after {display:block;visibility:hidden;clear:both;content:""}
.bo_vc_act li {float:left;margin-left:5px}

#bo_vc_w {position:relative;margin:0 0 10px;padding:0 0 20px;border-bottom:1px solid #cfded8}
#bo_vc_w h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_vc_w #char_cnt {display:block;margin:0 0 5px}

#bo_vc_sns {margin:0;padding:0;list-style:none;zoom:1}
#bo_vc_sns:after {display:block;visibility:hidden;clear:both;content:""}
#bo_vc_sns li {float:left;margin:0 20px 0 0}
#bo_vc_sns input {margin:0 0 0 5px}

이 질문에 댓글 쓰기 :

답변 4

폭이 가변적(반응형) 이든 고정적(px 이나 % 지정) 이든

현재 상속된 가로 너비 이상 되면 적용 될텐데요?

차근차근 한번 해보세요.

쪽지로 해당 부분 URL 보내주시면 한번 봐드릴께요.

감사합니다 ㅠㅠ 근데 문제가 <table> 코딩에 오버플로가 잘 먹히지 않는다고 하네요
그래서 게시판 영역을 <li>로 다시 코딩하라고 하시는데
그거는 아직 저에겐 무리라서.. 핫핫..

너비에 맞게 알아서 줄여줍니다.

아래 width 부분에 px 단위를 입력하면 해당 px 오버시 ellipsis(...) 가 적용됩니다.

 

 


<style type="text/css">
    div p {
        overflow: hidden; 
        text-overflow: ellipsis;
        white-space: nowrap; 
        width: 100%;
        height: 20px;
    }
</style>
<div>
  <p>행복은 구한다고 얻어지는 것이 아닌다. 항상 기쁜 마음을 가지고 살아가는 것, 이것이 행복을 불러들인다. 불행은 피한다고 해서 피해지는 것이 아니다. 항상 남의 마음을 아프게 하지 않도록 노력하는것, 이것이 불행을 멀리하게 한다. 즐거운 마음으로 착한 일을 많이 함으로써 복을 부르는 근본으로 삼고, 남을 해치려는 마음을 버림으로써 화를 멀리하는 근본으로 삼아야한다.</p>
</div>

 

 

스크린샷

833268658_1567179859.8802.png

반응형이라 width 을 px로 지정해두긴 어렵구요 ㅠㅠ

대신 display: block; 뚫고 나가는걸 이게 막아준다고 해서 썼더니만

제목에 맞춰서 너비가 오른쪽으로 늘어지는거에요 ㅠㅠ

사이드 창에까지 겹쳐지면서 늘어가네요

 

크롬 개발자도구에서도 이것저것 만지고 수정해보는데 별 반응이 없습니다 ㅠㅠ

아이고 또 멍청하게 제 질문에 답변을 달아버렸네요;;
스타일 잡아놓고 div로 감싸면 되는거죠?
적용해봤는데 제 게시판에는 잘 안되는 것 같아요 ㅠㅠ
필요한 부분만 잡아서 !important 를 때려도 제목 셀이 제목 길이 따라 우측으로 엄청 늘어나고
심지어 제목셀에 <td max-width = 를 걸어서 좁혀놔도 그상태 그대로네요.. ㅠㅠ

그래도 조언 주신 것 너무 감사드려요!

답변을 작성하시기 전에 로그인 해주세요.
전체 123,131 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT