CSS 로고는 텍스트 길이가 증가 할 때 위치를 변경합니다
문제
이것은 My "nofollow"> 코드 괜찮습니다.. 이것은 샘플 텍스트입니다. $ 244 "다음 자동 로고 이미지가 위치를 변경합니다.나는 로고가 그 위치를 변경하기를 원하지 않지만 그 자리에 남아 있어야하며 headline2txt의 영향을받지 않아야합니다.이 문제를 해결하는 방법은 무엇입니까?
<div id="wrapper">
<div id="mainContainer">
<p class="copyrights" id="copyrights"></p>
<div>
<img id="Image_Car" src="http://i.share.pho.to/25a090ef_c.png" />
</div>
<div id="headlineText">
<p id="headline1Txt" >Sample bag1</p>
<p id="headline2Txt" >Sale Price $25 </p>
</div>
<div id="disclaimer" >
Details*
</div>
<div id="Image_logo">
<img id="Imglogo" src="http://i.share.pho.to/93578bd4_o.png" />
</div>
<div >
<button class="btn btn-primary" type="button" id="ctaBtn"><div id="fadeIn" > Learn More Now </div></button>
</div>
</div>
#Image_logo img
{
position:relative;
width:140px;
height:30px;
top:-3px;
left:390px;
}
</div>
. 해결책
#image_logo img 에 position: relative;
가 있습니다. 아직 "절대적인 방법"을 배치하려고합니다.다음과 같이 CSS를 변경하십시오.
#Image_logo img {
position:absolute;
width:140px;
height:30px;
top:40px;
left:390px;
}
. 다른 팁
I may not understand what you're asking, but I think the lack of a float is throwing you. Adding some css like this..
<style>
#Image_logo img {
width:140px;
height:30px;
}
#wrapper {
float:left;
}
</style>
...should work. It should be in a separate .css file of course.
Try giving your #Image_logo img position: absolute instead of relative, then modify top, left etc. Then it should be always in the same place;
제휴하지 않습니다 StackOverflow