I have created vertical and horizontal lines with the <hr>
html tag, and have them inside a PHP script. The problem I have is that when you zoom on the site, the position of the lines move.
if you zoom (command key +/- on most browsers) the border i’ve made (with a div) stays in its place, but the horizontal and vertical lines do not.
Another thing I just want to mention is that I was unable to change the CSS script (stylesheet.css) because of the oscommerce 2.2 configuration.. It’s a very old version of the oscommerce server and I know it would probably be a better option to upgrade the server and look into templates, but I would like to figure out my problem here.
So let’s not talk about CSS since i’m not entitled to use it in this case.
Here is a snippet of the code:
<div style="width:680px;height:540px;border-radius: 20px;-webkit-border-radius: 20px;-moz-border-radius: 20px;-o-border-radius: 20px;border:1px solid #a4a4a4;background-color:#FFFFFF;">
<hr style="width: 0.3px; height: 480px; background: #333; position: absolute; left: 660px; top: 315px;">
<hr style="width: 0.3px; height: 480px; background: #333; position: absolute; left: 890px; top: 315px;">
<hr style="width: 610px; height: 0.3px; background: #333; position: absolute; left: 468px; top: 463px;">
<hr style="width: 610px; height: 0.3px; background: #333; position: absolute; left: 468px; top: 643px;">
<table width="100%" cellspacing="0" cellpadding="15">
</div>
4
Answers
ok i got it problem is you use
position:absolute
and its in browser behaviourand solution is give
position:relative
to its parentdiv
and rearrange yourhr
position according to you it works i tried in browser here is your hr code i modified it according to me you modify it according to you and don’t forget to give position relative to its parent divThat’s happening because you have absolute positions in your style… Try blocking all the divs into one div and aligning the hr’s with margins instead of “left” and “right”
Your
<hr/>
has absolute position, so it ok what it’s stay in same place while other elements move.You cannot open
<hr/>
after<table>
tag.This is wrong:
Need to be for example:
hr
and make it background of<td>
, or in last case of<table>
I suggeest to add
position:relative
toparent DIV
and changeHR width & height
to %Example:
Live: http://jsfiddle.net/ybBwT/