Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
682 views
in Technique[技术] by (71.8m points)

css - Prevent Twitter bootstrap empty <dd> filling with next <dd> value

Hello CSS gurus out there,

I love the twitter bootstrap, and I am prototyping a lot of projects based on it, I encountered this problem, where if the dd tag has no HTML inside of it, another dd takes it's place, I understand why this is happening, because of the way the dl is styled it allows dd to expand to more than one row if the content needs to, i don't want to break this lovely styling, i just want to modify it so if the dd value is empty, it just won't collapse, so before i do anything crazy here like server side to hide empty values, or modifying the original behavior or even adding jQuery, i wanted to know if anyone could help, this is a picture to illustrate further what i am saying, it's RTL so the dt is on the right.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I used this style override.

.dl-horizontal > dd:after {
  display: table;
  content: "";
  clear: both;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...