이 경우 줄 바꿈을 방지합니다
-
13-12-2019 - |
문제
이 HTML에서 줄 바꿈을 방지하려고합니다
창 크기를 조정할 때 아이콘과 텍스트가 모두 새 줄로 나뉩니다.나는 이미 공백 CSS 속성을 사용해 보았습니다.나는 또한 테이블 접근 방식을 시도했지만, 행동은 동일한
아무도 무슨 일이 일어나고 있는지 알 수 있습니까?
미리 감사드립니다
해결책
시도 :
.line {
height: 44px;
width: 100%;
display: inline-block;
background-color: #6c7987;
white-space: nowrap;
position: relative;
}
.icon {
position: absolute;
left: 0;
height: 44px;
width: 90px;
background-color:
#FF0080;
color: white;
text-align: center;
line-height: 44px;
font-family: Arial;
float: left;
font-size: 12px;
font-weight: bold;
padding: 0;
}
.title {
position: absolute;
left: 90px;
color: white;
line-height: 44px;
text-align: left;
padding: 0 0 0 10px;
font-family: Arial;
float: left;
font-size: 12px;
display: inline;
white-space:nowrap;
}
.botoes {
position: absolute;
width: 300px;
right: 0
}
.botao {
width: 46px;
height: 45px;
float: right;
line-height: 44px;
text-align: center;
display: block;
white-space:nowrap;
cursor: pointer;
}
.botaoVerRecurso {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoVerRecurso:hover {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoEditarRecurso {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoEditarRecurso:hover {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoFavRecurso {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoFavRecurso:hover {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoPartRecurso {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoPartRecurso:hover {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoApagarRecurso {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.botaoApagarRecurso:hover {
background: url('http://www.think-cell.com/images/cross.png') center no-repeat;
}
.clear {
clear: both;
}
.
간단합니다. 부동을 사용하면 홀더의 높이보다 큰 홀더에 더 큰 너비를 넣을 수 없으며 float은 자동으로 그것을 삭제하고 줄을 끊습니다.
위치를 사용하는 경우 다음과 같이 사용하십시오.
컨테이너 (위치 : 상대)
하위 요소 (posision : 절대, 상단 : 0, 왼쪽 : 0) <맨 위로 왼쪽 왼쪽
하위 요소 (posision : absolute, bottom : 0, 오른쪽 : 0) <오른쪽 하단에 놓습니다
다른 팁
문제를 끊어 지도록 이해하는 경우 텍스트와 "X"아이콘이 아래로 점프하지 않고 창 너비의 크기를 조정해야합니다.
.title
에서 CSS 제거
min-width: 500px;
.
이 !
제휴하지 않습니다 StackOverflow