Please see the html below
it works fine in IE, but in Firefox it overlaps..please try and give me solution.
When the position of the div inside the td was given static, it's working properly.But i need absolute there since i need to use the left and top attributes.Any help is appreciated.Thanks
<table style="height:auto; position:fixed;">
<tr>
<td style="width:210px;padding:6px 6px 6px 6px;" class="contentBoxcontent">
<div style="LEFT: 20px; WIDTH: 154px; CURSOR: move; POSITION: absolute; TOP: 0px; HEIGHT: 29px;" >Traffic Light</div>
<div style="LEFT: 0px; WIDTH: 161px; CURSOR: move; POSITION: absolute; TOP: 33px; HEIGHT: 110px;" ><img src="../common/Images/rollingstock.png" width="100%" height="100%" /></div>
<div style="LEFT: 0px;WIDTH: 198px; CURSOR: move; POSITION: absolute; TOP: 154px; HEIGHT: 66px;" ><ul><li>Traffic Light Information</li><li>Signalling Information</li><li>Euro Light</li></ul></div>
</td>
<td style="width:210px;padding:6px 6px 6px 6px;" class="contentBoxcontent">
<div style="LEFT: 10px;WIDTH: 154px; CURSOR: move; POSITION: absolute; TOP: 0px; HEIGHT: 29px;">LED Dialight Iformation</div>
<div style="LEFT: 0px;WIDTH: 161px; CURSOR: move; POSITION: absolute; TOP: 33px; HEIGHT: 110px;"><img src="../common/Images/EN-12368_Euro.png" width="100%" height="100%" /></div>
<div style="LEFT: 0px;WIDTH: 198px; CURSOR: move; POSITION: absolute; TOP: 154px; HEIGHT: 66px;"><ul><li>Traffic Light Information</li><li>Signalling Information</li><li>Caltran Signals Light</li></ul></div>
</td>
<td style="width:210px;padding:6px 6px 6px 6px;" class="contentBoxcontent">
<div style="LEFT: 10px;WIDTH: 154px; CURSOR: move; POSITION: absolute; TOP: 0px; HEIGHT: 29px;">Signalling Information</div>
<div style="LEFT: 0px;WIDTH: 161px; CURSOR: move; POSITION: absolute; TOP: 33px; HEIGHT: 110px;"><img src="../common/Images/caltransignals.png" width="100%" height="100%" /></div>
<div style="LEFT: 0px;WIDTH: 198px; CURSOR: move; POSITION: absolute; TOP: 154px; HEIGHT: 66px;"><ul><li>Traffic Light Information</li><li>Signalling Information Light Test Data..</li><li>LED Light</li></ul></div></td>
</tr>
</table>
Well of course it overlaps. In every browser. You're absolute-positioning elements with exactly the same left/top values, how could it not? (Plus you're using position: fixed, which won't work in IE6, but will establish a different containing parent in other browsers.)
As Richard says, you could give each td element position: relative so that the absolutes inside are positioned relative to the cell. But if, as it looks like, all you want is three divs side-by-side, forget both absolute positioning and tables, and just say:
<style>
.contentBoxcontent {
float: left;
width: 201px; height: 205px;
padding: 6px; margin: 2px;
cursor: move;
}
.contentBoxcontent a { margin-left: 10px; height: 29px; }
.contentBoxcontent img { display: block; width: 161px; height: 110px; }
</style>
<div class="contentBoxcontent">
Traffic light
<img src="../common/Images/rollingstock.png" alt="" />
<ul>
<li>Traffic light information</li>
<li>Signalling information</li>
<li>Euro light</li>
</ul>
</div>
<div class="contentBoxcontent">
LED dialight information
<img src="../common/Images/EN-12368_Euro.png" alt="" />
<ul>
<li>Traffic light information</li>
<li>Signalling information</li>
<li>Caltran signals light</li>
</ul>
</div>
<div class="contentBoxcontent">
Signalling information
<img src="../common/Images/caltransignals.png" alt="" />
<ul>
<li>Traffic light information</li>
<li>Signalling information</li>
<li>Light test data</li>
<li>LED light</li>
</ul>
</div>
Related
Havent touched html/css in years so I need some help. I have a nested list, and want to style the outer list (#todo), and just have 'normal' bullets on the inside list (#task). Problem is when I style the outer list it automatically styles the inside list as well. As a rigged fix, i thought of removing the li tags from and just making them <p> and somehow add a bullet to the front of them. How do you add bullets to the front of <p> tag?
#parent .todo ul li:before{
content: "";
position: absolute;
top: 5px;
left: -25px;
width: 6px;
height: 6px;
border-radius: 50%;
border: 2px solid #0bb5f4;
}
#parent .todo ul li:after{
content: "";
position: absolute;
top: 14px;
left: -21px;
width: 2px;
height: 75px;
background: #0bb5f4
}
.task{
padding-left: 25px;
}
<div class="todo">
<div class="title">
<p class="bold">Title1</p>
</div>
<ul>
<li>
<div class="date">today</div>
<div class="info">
<p class="semi-bold">Name</p>
<p class="description"><em>location</em></p>
<div class="task">
<p>task1</p>
<p>task2</p>
<p>task3</p>
</div>
</div>
</li>
<li>
<div class="date">yesterday</div>
<div class="info">
<p class="semi-bold">Name2</p>
<p class="description"><em>location2</em></p>
<div class="task">
<p>item1</p>
<p>item2</p>
<p>item3</p>
</div>
</div>
</li>
</ul>
</div>
Add a class on the li elements of the outer list and apply the styles you want to apply on the outer list, on this class. This way, inner list's li elements won't be styled.
.outer-li {
position: relative;
list-style: none;
margin: 10px 0 0 0;
}
.outer-li::before {
content: "";
position: absolute;
top: 5px;
left: -25px;
width: 6px;
height: 6px;
border-radius: 50%;
border: 2px solid #0bb5f4;
}
.outer-li::after {
content: "";
position: absolute;
top: 14px;
left: -21px;
width: 2px;
height: 75px;
background: #0bb5f4
}
<div class="todo">
<div class="title">
<p class="bold">Title1</p>
</div>
<ul class="outer">
<li class="outer-li">
<div class="date">today</div>
<div class="info">
<p class="semi-bold">Name</p>
<p class="description"><em>location</em></p>
<ul class="task">
<li>task1</li>
<li>task2</li>
<li>task3</li>
</ul>
</div>
</li>
<li class="outer-li">
<div class="date">yesterday</div>
<div class="info">
<p class="semi-bold">Name2</p>
<p class="description"><em>location2</em></p>
<ul class="task">
<li>task1</li>
<li>task2</li>
<li>task3</li>
</ul>
</div>
</li>
</ul>
</div>
Alternatively, you could use ::before pseudo selector.
li {
position: relative;
list-style: none;
margin: 10px 0 0 0;
}
li::before {
content: "";
position: absolute;
top: 5px;
left: -25px;
width: 6px;
height: 6px;
border-radius: 50%;
border: 2px solid #0bb5f4;
}
li::after {
content: "";
position: absolute;
top: 14px;
left: -21px;
width: 2px;
height: 75px;
background: #0bb5f4
}
.task {
padding-left: 25px;
}
.task p {
position: relative;
}
.task p::before {
content: '';
position: absolute;
background: #222;
width: 5px;
height: 5px;
left: -13px;
top: 50%;
transform: translateY(-50%);
border-radius: 50%;
}
<div class="todo">
<div class="title">
<p class="bold">Title1</p>
</div>
<ul>
<li>
<div class="date">today</div>
<div class="info">
<p class="semi-bold">Name</p>
<p class="description"><em>location</em></p>
<div class="task">
<p>task1</p>
<p>task2</p>
<p>task3</p>
</div>
</div>
</li>
</ul>
</div>
I want to fixed the "X" button inside the popup and sticky top.
But position:fixed & position:absolute both not working.
It will work fine if I using IOS google chrome and safari.
.popup-inner {
position: absolute;
bottom: 0px;
overflow: auto;
padding-bottom: 30px;
-webkit-text-size-adjust: none;
}
.popup-close {
width: 30px;
height: 30px;
position: fixed;
top: 25px;
right: 20px;
}
<a class="btn" data-popup-open="popup-1" href="#"><i class="fa fa-globe" aria-hidden="true"></i>popup</a>
<div class="popup" data-popup="popup-1">
<div class="popup-overlay"></div>
<div class="popup-inner">
<div class="fixed-content">
<div class="col-main">
<div>123</div>
<div class="content">
<ul>
<li>
<a>
<span>aaaaa</span>
<div class="lan">bbbb</div>
</a>
</li>
</ul>
</div>
</div>
</div>
<a class="popup-close" data-popup-close="popup-1" href="#">
<div class="popup-icon"></div>
</a>
</div>
</div>
JSFiddle Here
Thanks for help.
I would suggest some CSS fixes
CSS
.popup-icon{
height:30px;
width:30px;
position: relative;
}
.popup-icon:before,
.popup-icon:after {
content: "";
position: absolute;
display: block;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
height: 3px;
background: #aaa;
margin: auto;
}
Link for reference
I have updated this post, as i seem to be facing a new issue with this image problem, basically, i need to center an image on all devices.
Here is the HTML of the images, all images must stay as they are as its a custom menu.
body { font-family: 'Roboto', sans-serif; background-color:#2d2d2d; color: #f5f5f5; margin: 0 auto; padding:0; font-size:12pt; padding-top:20px; padding-bottom:20px; }
}
#box2 {
display:block;
margin:auto;
height:500px; /*change ## to the pixel setting of your image*/
width:500px;/*change ## to the pixel setting of your image*/
}
#media screen and (max-width: 768px) {
body { padding:0; background-image: none !important; }
}
<?php
/*
Template Name: Page Menu
*/
?>
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<style>
body {background-color:black}
</style>
<div id="body">
<div id="box2" "style="position: absolute">
<a href=""><img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/111.png" width="500" align="middle" style="position: absolute; top: 100px; left: 500px; "/>
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" width="65" style="position: absolute; border: 0px solid white; top: 240px; left: 530px; "/>
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" width="65" style="position: absolute; border: 0px solid blue; top: 170px; left: 785px;"/>
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" width="65" style="position: absolute; border: 0px solid green; top: 140px; left: 650px;"/>
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" width="65" style="position: absolute; border: 0px solid red; top: 280px; left: 890px;"/>
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" width="65" style="position: absolute; border: 0px solid purple; top: 435px; left: 565px;"/>
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" width=65" style="position: absolute; border: 0px solid grey; top: 435px; left: 820px;"/>
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" width="65" style="position: absolute; border: 0px solid yellow; top: 325px; left: 690px;"/>
</div>
</div>
I just need the main image to be centered on all devices, basically just in the middle of 100% screen width, finding it hard to do so have no idea why
OK, I had to change some stuff around. Images are bigger than they were you may have to resize as well, but stay in place now.
<!doctype html>
<html>
<style>
body {
background-color: black;
}
img {
position: absolute;
}
</style>
<body>
<div class="navigation">
<div "style="position: relative">
<a href="http://tridentas.co.uk/bowwownow">
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp- content/uploads/2015/10/home1.png" style: "width= 65; border: 0px solid white; top: 22%; left: 42%;"/></a>
<a href="http://tridentas.co.uk/bowwownow">
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" style= "width= 65; border: 0px solid blue; top: 170px; left: 715px;"/></a>
<a href="http://tridentas.co.uk/bowwownow">
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" style= "width= 65; border: 0px solid green; top: 230px; left: 460px;"/></a>
<a href="http://tridentas.co.uk/bowwownow">
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" style= "width= 65; border: 0px solid red; top: 260px; left: 825px;"/></a>
<a href="http://tridentas.co.uk/bowwownow">
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" style= "width= 65; border: 0px solid purple; top: 405px; left: 490px;"/></a>
<a href="http://tridentas.co.uk/bowwownow">
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" style= "width= 65; border: 0px solid grey; top: 405px; left: 760px;" />
</a>
<a href="http://tridentas.co.uk/bowwownow">
<img src="http://www.tridentas.co.uk/tridentascouk/bowwownow/wp-content/uploads/2015/10/home1.png" width="65" style="position: absolute; border: 0px solid yellow; top: 305px; left: 625px;" />
</a>
</div>
</div>
</body>
</html>
I know this a rather specific question and basic html question, but it's been happening on a few of my pages now, and I'm curious as to what exactly is going on.
I have a series of div boxes lined up vertically on a page, each one contains a picture that is a link to a different page on the website. The problem is when I add more than 3 of these div boxes, suddenly all the links on above the bottom three stop working.
http://webstage.emich.edu/dining-new/locations/easterneateries.php
I've tried the same code in jsfiddle, as seen below:
.locationsbx {
position:absolute;
width: 540px;
height:70px;
z-index:5;
margin-left: auto;
margin-right:auto;
background-color: #363636;
margin-top:110px;
}
.primetriangle {
border-top:25px solid green;
height: 0;
position:absolute;
width: 0;
z-index:3;
border-right: 25px solid transparent;
height: 0;
position:absolute;
width: 0;
z-index:5;
border-top-color: #CCC;
}
<div class="locationsbx" style="position: absolute; width: 100%; height: 100px; margin-top: 20px;">
<div class="primetriangle" style="z-index: 4;"></div> <img style="width: 85px; margin-left: 5px; margin-top: -18px;" src="/dining-new/images/eateries/estreet.png" alt="" />
<div class="text" style="margin-left: 100px; margin-top: -35px; width: 430px;">text</div>
<div style="position: absolute; margin-left: 270px; margin-top: 45px; width: 320px;">
<img style="height: 35px;" src="/dining-new/images/open.png" alt="" />
<img style="margin-left: 2px; height: 35px; display: inline;" src="/dining-new/images/menu.png" alt="" onmouseover="this.src='/dining-new/images/menu_hover.png';" onmouseout="this.src='/dining-new/images/menu.png';" />
<img style="margin-left: 2px; height: 35px; display: inline;" src="/dining-new/images/nutrition.png" alt="" onmouseover="this.src='/dining-new/images/nutrition_hover.png';" onmouseout="this.src='/dining-new/images/nutrition.png';" />
</div>
</div>
<div class="locationsbx" style="position: absolute; width: 100%; height: 100px; margin-top: 130px;">
<div class="primetriangle" style="z-index: 4;"></div> <img style="width: 85px; margin-left: 5px; margin-top: -18px;" src="/dining-new/images/eateries/sunsetstripslogo.png" alt="" />
<div class="text" style="margin-left: 100px; margin-top: -35px; width: 430px;">text</div>
<div style="position: absolute; margin-left: 270px; margin-top: 45px; width: 320px;">
<img style="height: 35px;" src="/dining-new/images/open.png" alt="" />
<img style="margin-left: 2px; height: 35px; display: inline;" src="/dining-new/images/menu.png" alt="" onmouseover="this.src='/dining-new/images/menu_hover.png';" onmouseout="this.src='/dining-new/images/menu.png';" />
<img style="margin-left: 2px; height: 35px; display: inline;" src="/dining-new/images/nutrition.png" alt="" onmouseover="this.src='/dining-new/images/nutrition_hover.png';" onmouseout="this.src='/dining-new/images/nutrition.png';" />
</div>
</div>
<div class="locationsbx" style="position: absolute; width: 100%; height: 100px; margin-top:240px;">
<div class="primetriangle" style="z-index: 4;"></div> <img style="width: 85px; margin-left: 5px; margin-top: -18px;" src="/dining-new/images/eateries/sunsetstripslogo.png" alt="" />
<div class="text" style="margin-left: 100px; margin-top: -35px; width: 430px;">text</div>
<div style="position: absolute; margin-left: 270px; margin-top: 45px; width: 320px;">
<img style="height: 35px;" src="/dining-new/images/open.png" alt="" />
<img style="margin-left: 2px; height: 35px; display: inline;" src="/dining-new/images/menu.png" alt="" onmouseover="this.src='/dining-new/images/menu_hover.png';" onmouseout="this.src='/dining-new/images/menu.png';" />
<img style="margin-left: 2px; height: 35px; display: inline;" src="/dining-new/images/nutrition.png" alt="" onmouseover="this.src='/dining-new/images/nutrition_hover.png';" onmouseout="this.src='/dining-new/images/nutrition.png';" />
</div>
</div>
<div class="locationsbx" style="position: absolute; width: 100%; height: 100px; margin-top: 350px;">
<div class="primetriangle" style="z-index: 4;"></div> <img style="width: 85px; margin-left: 5px; margin-top: -18px;" src="/dining-new/images/eateries/sunsetstripslogo.png" alt="" />
<div class="text" style="margin-left: 100px; margin-top: -35px; width: 430px;">text</div>
<div style="position: absolute; margin-left: 270px; margin-top: 45px; width: 320px;">
<img style="height: 35px;" src="/dining-new/images/open.png" alt="" />
<img style="margin-left: 2px; height: 35px; display: inline;" src="/dining-new/images/menu.png" alt="" onmouseover="this.src='/dining-new/images/menu_hover.png';" onmouseout="this.src='/dining-new/images/menu.png';" />
<img style="margin-left: 2px; height: 35px; display: inline;" src="/dining-new/images/nutrition.png" alt="" onmouseover="this.src='/dining-new/images/nutrition_hover.png';" onmouseout="this.src='/dining-new/images/nutrition.png';" />
</div>
</div>
and it's working fine there- so I'm confused as to what might be some of the reasons why putting the code on the actual server would be causing problems with disabling the links.
Any thoughts/explanations would be super super appreciated
**NOTE: I am well aware that it is not in good form to have inline styles, especially when I have the external CSS sheet anyways. However, the inline styles are just there until I can resolve the actual problem with the links.
** ALSO: The link to the page is very obviously under construction still. I have been dealing with the disabled links over multiple pages now and am much more concerned with why they're disabling than the rest of the page
I went to check the source of your page you linked to and you're not closing the <div> with the class="locationsbx" on your page. I think you're doing in the code you pasted above but not on the actual page.
EDIT: Not really a complete answer. I would have just left a comment but I need 50 points for that, I don't have those.
I'm crap with css.
I began building a page with the body set to absolute, and build all elements around this.
When the browser zoom changes, the positioning goes & nothing looks correct (only correct # 100% ).
I changed the body to be relative and re-structed so the main divs that build up the page are running off of the body.
However, it seems I've truly funked this one.
nearly all elelments hide away when updating the body to be relative, even though I understand absolute & relative to work together (parent/child).
ScreenShots:
(Should Look like this (all position absolute))
(The issue I'm trying to resolve. zooming in/out causes the tabs to move up/down (above & below))
(This is when I set body to relative, yes, that's the whole page shot.(below))
css:
body{
position: relative;
margin: 0;
width: 100%;
height: 100%;
//font-family: Arial;
zoom: 100%;
}
#invoiceOptions{
position: absolute;
background-color: #f9dede;
top: 11.9%;
left: 10%;
width: 80%;
height: 33.5%;
border-radius: 10px;
font-size: 15pt;
}
#referals{
position: absolute;
//background-color: #C93939;
top: 11.9%; //11
left: 10%;
width: 80%;
height: 33.5%;
font-size: 15pt;
border-radius: 1%;
}
#orders{
position: absolute;
//background-color: #C93939;
//background-image: url('background.png');
background-repeat: no-repeat;
top:11.9%;
left:10%;
width: 80%;
height: 75%;
border-radius: 1%;
font-size: 15pt;
overflow: scroll;
overflow-x: hidden;
overflow-y: hidden;
}
#orders:hover{
overflow-y: visible;
}
#toolbar{
position: absolute;
background-color: white;
width: 80%;
left: 8%;
height: 20%;
border-radius: 5px;
}
#border1{
position: absolute;
width: 10%;
height: 100%;
background-color: black;
//same for border2, but on right.
}
.tab-links{
position: absolute;
width: 40%;
top: 28.5%;
left: 3%;
background: no-repeat;
border-radius: 20px 20px 0px 0px;
background-color: #dbdbdb;
box-shadow: -1px 1px 1px rgba(0,0,0,0.15);
}
html.
<body>
<div id="toolbar">
<div style="">
<h4 style="position: absolute; top: 5%; left: 15%;">Welcome <?php echo $User[0]; ?>!</h4>
<ul class="tab-links">
<li class="active">Orders <div id='orderCount' style='display: inline;'></div></li>
<li>Referrals <div id='referralCount' style='display: inline;'></div></li>
<li>Options</li>
</ul>
<div style="">
<a href="https://XXXXXXXX.com/mysagepay/" target="_blank">
<IMG style="position: absolute; border-radius: 5%; left: 60%;" border=0 alt=SagePay src="https://live.sagepay.com/mysagepay/images/sagepay_logo.png" width=136 height=50>
</a>
<A href="https://www.businessexpress-uk.com/" target="_blank">
<IMG style="position: absolute; border-radius: 5%; left: 70%;" border=0 alt=SagePay src="https://XXXX.com/Content/images/logo.png" width=140 height=50>
</A>
<A href="http://XXXXX.co.uk/support/staff/" target="_blank">
<IMG style="position: absolute; border-radius: 5%; left: 80%;" border=0 alt=Fusion src="http://XXXXX.co.uk/support/__swift/themes/__cp/images/fusion.gif" width=200 height=50>
</A>
</div>
</div>
</div>
<div class="tab-content">
<div id="tab1" class="tab active">
<div id="orders">
<div class="CSSTableGenerator">
<table width="100%" class='table'>
<thead>
<tr>
<td><b>Customer</b></td>
<td><b>Company</b></td>
<td>User ID</td>
<td><b>Time</b>
</tr>
</thead>
<tbody id="orderBody">
</tbody>
</table>
<div id="orderHolder"></div>
</div>
</div>
<div id="print">
<img src="print.png" title="Print All Invoices"/>
</div>
</div>
<div id="tab2" class="tab">
<div id="referals">
<div class="CSSTableGenerator">
<table width='100%' class='table'>
<thead>
<tr>
<td><b>Account</b></td>
<td><b>Customer</b></td>
<td><b>Referral ID</b></td>
<td><b>UUID</b></td>
<td><b>Time</b></td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
<div id="hold"></div>
</div>
</div>
</div>
<div id="tab3" class="tab">
<div id="invoiceOptions">
<div id="DisplayOptions">
<fieldset style="width: 100%;">
</fieldset>
</div>
</div>
</div>
</div>
<div id='border1'></div>
<div id='border2'></div>
</body>
Notes.
I'm using ajax to populate a web-gen table. I've excluded the table css for now, however comment if required & I will include
update.
I've included tab-links into the css. this is the css for the holder of the tab buttons (grey). The tab buttons themselves are floated left.
the table contents, is a styleless div contaings the 3 tab option contents (referral, order & options).