html - How to get text to stay in position on browser and device scale -
i got copy im needing put in footer. can position .special how nicely when browser set 1920px view, if change resolution or device looking @ position of text starts shift out of position. have tried using percentages when reaches point still not @ desired static position id be.
so there way make div .special stay in same position regardless of scale not want cross on or move far away divder div .divide. id same .reason positioned on other side of .divide div im wanting .special text stay in position stay same on scale changes (sorry site isnt live cant link much, general idea me tweak help, thanks!)
here html , css relevant topic:
<!--===================================================content===================================================!--> <div class="contentwrap"> <div class="textwrap"> <div class="special"> <p>specializations</p> <p>with various skills in branding,<br /> multi-media , advertising able provide<br /> fresh , inspiring solutions task given me. <br /> using various programs such as:</p> </div> </div><!--close textwrap--> <div class="content"> <div class="divide"> </div><!--close divide!--> </div><!--close content!--> <div class="reason"> <p>specializations</p> <p>with various skills in branding,<br /> multi-media , advertising able provide<br /> fresh , idsapiring solutions task given me. <br /> using various programs such as:</p> </div><!--close reason!--> </div><!--close contentwrap!-->
css
/*---------------------------- content ----------------------------*/ .contentwrap{ position:relative; top:500px; width:100%; z-index:500; #171717 } .content{ position:relative; height:290px; min-height:212px; -moz-box-shadow: 0px -10px 20px 0px #000; -webkit-box-shadow: 0px -10px 20px 0px #000; box-shadow: 0px -10px 10px 0px #000; margin:0 auto; } .textwrap{ position:absolute; width:100%; background:#090; } .special{ position:relative; text-align:center; width:350px; left:400px; background:#006; } .divide{ position:absolute; background:url(../images/divide.png) no-repeat top; width:100%; height:190px; top:40px; z-index:1000; } .reason{ position:absolute; text-align:center; width:350px; left:800px; background:#006; }
you using lot of position: absolute
or position: relative
attributes. these kind of "rational" in positioning divs. easier work margin
, padding
.
for example, check code css removed: js fiddle demo. works quite , displayed inside screen (on every device/size).
if want stylize it, can use margin
add space around elements, or padding
stretch them. @ first, seems kind of same thing, important understand difference. » read more them here.
as quite hard, understand layout or question, have tried edit html stays inside viewport , creating example styles, idea:
Comments
Post a Comment