HTML div needs to be on top of all other controls - html

Some controls on the parent screen are bleeding through the div (see image). I need this div to be on top of all other controls. Right now the radio button list and the tabs are somehow on top.
Here is the declaration of the dialog box:
<div id="divSaveAnalysis" style="display: block; opacity: 100; width: 350px; font-size: 40px; position: absolute; top: 35px; left: 100px; background-color: rgb(247, 219, 111); padding: 15px; border: 1px solid #000;">
<div id="saving" style="font-size:medium; font-weight:bold;">
<span id="savingSpan" style="font-size: xx-large">Saving Analysis...</span>
<img src="css/images/Indicators/Activity/GearGreen_66x66.gif" style="float: right; height: 80px;"
title="Saving FLSA Analysis" alt="Saving..." />
<br />
<br />
<div><span id="savingReport" style="font-size: small;"></span></div>
<div><span id="savingInputs" style="font-size: small;"></span></div>
<div><span id="savingResults" style="font-size: small;"></span></div>
<div><span id="savingComplete" style="font-size: small;"></span></div>
</div>
</div>
The computed styles for the div are:
background-color: rgb(247, 219, 111);
border-bottom-color: rgb(0, 0, 0);
border-bottom-style: solid;
border-bottom-width: 0.9090908765792847px;
border-left-color: rgb(0, 0, 0);
border-left-style: solid;
border-left-width: 0.9090908765792847px;
border-right-color: rgb(0, 0, 0);
border-right-style: solid;
border-right-width: 0.9090908765792847px;
border-top-color: rgb(0, 0, 0);
border-top-style: solid;
border-top-width: 0.9090908765792847px;
color: rgb(51, 51, 51);
display: none;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 40px;
height: auto;
left: 100px;
line-height: 17.99715805053711px;
opacity: 1;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
padding-top: 15px;
position: absolute;
text-align: left;
top: 35px;
visibility: visible;
width: 350px;

You can use z-index to change the way the contact stacks. By default it's based of the order the content loads with the page.
By default z-index is 'auto'. Try setting it to an integer like 100.
z-index:100;
position:absolute;
When you use z-index you have to also change the position value for the content.
You can read more about z-index here http://www.w3.org/TR/CSS2/visuren.html#z-index

Setting the z-index will control the stacked order of elements.
#divSaveAnalysis {
z-index:10000;
}

you need to add property of
z-index:99999;
and make sure to add
position: relative;
for the z-index to work.

Related

Div Outline visible in IE/Edge even though div is hidden

I have a text engine that generates HTML/CSS. Below is some text that it generated.
#text516 {
position: absolute;
left: 197px;
top: 168px;
width: 201px;
height: 81px;
visibility: hidden;
z-index: 1;
background-clip: padding-box;
border-style: solid;
border-width: 5px;
border-color: rgb(0, 120, 228);
outline-style: solid;
outline-width: thin;
outline-color: rgb(0, 120, 228);
}
span.text516Font1 {
font-size: 16px;
font-family: "Arial", sans-serif;
color: #010101;
}
<div id="text516" style="width: 201px; height: 81px;">
<a tabindex="1" id="text516anc" style="display:block;height:0px;width:0px;"></a>
<table style="border-collapse:collapse;top:0px;position:absolute; border-spacing:0; width:100%; height:100%">
<tbody>
<tr>
<td style="position: absolute;top:0px;left:0px;box-sizing:border-box;width:100%;vertical-align:top;height:100%;padding:5px">
<div style="height:100%;width:100%;overflow-y:hidden;overflow-x:hidden;">
<p style="margin-left:0px;text-indent:0px;line-height:1.350;margin-top:0px;margin-bottom:0px;text-align:left;" dbg_tag_42="" leglh="1.409" dbg_tag_34.1a="">
<span class="text516Font1" style="position:relative;top:-2px;" dbg_tag_95="">hi my name is matthew and I like pie.
</span></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
Also, here is a JSFiddle Link to see the problem ( Only in IE/Edge )
There are a few things I can do to fix this problem, such as removing the style attribute from the span encapsulating the text. I can also remove the table elements and leave just the p tag, but when left as it is above, the outline always shows regardless of the fact that the outer div is set to be hidden. Is this a bug with the browser, or is it some HTML functionality that I am missing?

How to make this div be fixed always on the top of all element on the webpage?

Getting This Output on my Blog. (Language is Bengali)
I want it to float always on the front of all element. But Some Contents are overriding it. how to solve it?
Blog: http://www.blogger-tawsif.ga/
Code is,
<div class="grplusbd_floating_likebox">
<span class="iconContainer">
<img class="ico" src="http://lh3.googleusercontent.com/-jpijNi_XBh4/AAAAAAAAAAI/AAAAAAAAB_0/P3R_olWI_KI/s512-c/photo.jpg"/>
</span>
<iframe id="floatfollow" allowtransparency="true" frameborder="0" height="50" scrolling="no" src="https://www.facebook.com/plugins/follow.php?href=https%3A%2F%2Fwww.facebook.com%2Ftawsif.torabi&width=64&height=65&layout=box_count&size=small&show_faces=true&appId=164293520647951" style="border:none;overflow:hidden; vertical-align: middle; float: right;" width="64"></iframe>
</br>
<span style="font-weight: bold; color: white;">
Tawsif Torabi
</span>
</br>
<small style="font-weight: bold; color: white;">
Web Developer, GR+ Bangladesh
</small>
</div>
<style>
.grplusbd_floating_likebox {
position: fixed;
top: 500px;
left: 0px;
border-radius: 0px 10px 10px 0px;
padding: 10px 15px;
background-color: rgba(255, 0, 0, 0.93);
box-shadow: 1px 1px 7px black;
}
.iconContainer {
border-radius: 50px;
display: inline-block;
overflow: hidden;
vertical-align: middle;
}
img.ico{
vertical-align:middle;
height: 45px;
width: auto;
}
</style>
Do you mean in front? If so add:
z-index: 9999;
If top yeah someone already answered the top and left positions

Control side that shortens when changing div height on hover

I'm using this hover effect for buttons, but in a few cases when the height changes, the top remains the same and the bottom moves up, instead of vice versa like it should. How can I make sure it always goes in the correct direction?
jsfiddle
.button {
box-sizing: border-box;
display: inline-block;
width: 215px;
height: 55px;
color: white;
font-family: $arial;
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
text-align: center;
text-decoration: none;
text-shadow: 1px 1px 1px rgba(43, 36, 36, 0.35);
letter-spacing: .1em;
border-radius: 3px;
position: relative;
background: #009ee0;
border: 1px solid #148fc6;
border-bottom: 4px solid #148fc6;
}
.button:hover {
border-bottom: 1px;
height: 53px;
}
.button span {
position: absolute;
width: 90%;
left: 0;
right: 0;
margin: auto;
top: 50%;
transform: translateY(-43%);
line-height: 1.2;
}
div {
padding: 20px 5px;
}
<div>
<a href="#" class="button">
<span>Wrong way</span>
</a>
</div>
<div>
<a href="#" class="button">
<span>I work fine</span>
</a>
<a href="#" class="button">
<span>I work fine</span>
</a>
</div>
You're reducing the height from 55px to 53px. That 2px has to go somewhere. The top button is just collapsing it. (The bottom two are doing the same, it just doesn't look like it because they are being affected by vertical text alignment). change your hover rule to this to accommodate for the height loss.
.button:hover {
border-bottom: 1px;
margin-top: 2px;
height: 53px;
}
https://jsfiddle.net/exd6hhvz/
I was able to make it work consistently by adding margin-top: 2px; to .button:hover
Here's an example: https://jsfiddle.net/vf03czp5/

How can my button's position be centered without any kind of "margin cheat"?

How can I place my button in the center without any kind of "margin cheat" (for example setting margin-left: 525px;)?
HTML
<div id="banner">
<div id="bannerContainer">
<h1>H1 tag</h1>
Products
</div>
</div>
CSS
.bannerButton {
border: 2px solid #fff;
color: #fff;
font-weight: 300;
font-family: 'Raleway';
font-size: 20px;
display: inline-block;
background-color: rgb(63, 127, 191);
padding: 18px 60px 18px 50px;
margin-bottom: 50px;
margin-top: 50px;
position: relative;
margin-left: 525px;
}
.bannerButton:hover {
text-decoration: none;
background: #eaf;
color: #fff;
}
I've tried making it sit in the center but it didn't work out so well without me setting margin-left; 525px;, which in my case, centers the button under the text, please help me remove this "margin cheat" and do it in the right way.
The a act like text it means when you give text-align:center; to its parent, it will be placed in center of its parent.
You don't need to give margin to the a element. You can use text-align:center;.
#bannerContainer
{
text-align:center;
}
.bannerButton {
border: 2px solid #fff;
color: #fff;
font-weight: 300;
font-family: 'Raleway';
font-size: 20px;
display: inline-block;
background-color: rgb(63, 127, 191);
padding: 18px 60px 18px 50px;
margin-bottom: 50px;
margin-top: 50px;
position: relative;
}
.bannerButton:hover {
text-decoration: none;
background: #eaf;
color: #fff;
}
<div id="banner">
<div id="bannerContainer">
<h1>H1 tag</h1>
Products
</div>
</div>
If you set the position of the button to absolute, give it a set width, and add this it should center:
left: 50%; right: 50%;
Have you try this:
<center>Products</center>
I am not sure whether it is helpful to you..

Aligning Font-Width across 3 Major Browsers

I currently have 4 Divs, each of which contains a hyperlink. Each hyperlink is a member of the navigation bar at the top of a website. The rightmost link must line up with elements below it. I should be able take a vertical line ruler and see the rightmost elements align at the right-most edge of the page.
My rendered HTML looks great in Chrome, but not in FireFox, or IE: the links are not as wide and the page looks weird because the fourth link doesn't hit the right edge of the page.
I believe this has to do with font width definitions, however I do not know what to manually set.
FireFox CSS Computed Text:
font-family Lucida Sans Unicode
font-size 16px
font-weight 600
font-style normal
font-size-adjust none
color #EEFFFF
text-transform none
text-decoration none
letter-spacing normal
word-spacing 0
line-height 23px
text-align start
vertical-align baseline
direction ltr
-moz-tab-size 8
-moz-font-feature-settings normal
-moz-font-language-override normal
-moz-text-blink none
-moz-text-decoration-color #EEFFFF
-moz-text-decoration-line none
-moz-text-decoration-style solid
text-overflow clip
Chrome Computed Style:
background-attachment: scroll;
background-clip: border-box;
background-color: #D00;
background-image: none;
background-origin: padding-box;
border-bottom-color: #B00;
border-bottom-style: solid;
border-bottom-width: 1px;
border-left-color: #B00;
border-left-style: solid;
border-left-width: 1px;
border-right-color: #B00;
border-right-style: solid;
border-right-width: 1px;
border-top-color: #B00;
border-top-style: solid;
border-top-width: 1px;
color: white;
cursor: auto;
display: inline;
float: none;
font-family: 'Lucida Sans Unicode';
font-size: 16px;
font-weight: 600;
height: auto;
line-height: 23px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding-bottom: 17px;
padding-left: 10px;
padding-right: 10px;
padding-top: 17px;
text-decoration: none;
width: auto;
---Append---
<div id="LinkContainer">
<div class="Link">
Variable Length Text A
</div>
<div class="Link">
Variable B
</div>
<div class="Link">
Variable Length Text C Really Long
</div>
<div class="Link">
Var D
</div>
</div>
#LinkContainer
{
position:absolute;
float: left;
margin-top:165px;
margin-bottom:5px;
margin-left:225px;
width:680px;
}
.Link
{
float:left;
margin: 0px 1px 0px 1px;
padding: 00px 0px 20px 0px;
color: #EFF;
font-weight:600;
font-family:Lucida Sans Unicode;
font-size: 16px;
}
.mnu-hover
{
background: #C00;
text-decoration: none; /* color: #FFF; */;
border: solid 1px #B00;
padding: 15px 10px 15px 10px;
margin: 0 0 0 0;
color: #EEE;
}
.mnu-hover:hover
{
background: #D00;
border: solid 1px #B00;
padding: 17px 10px 17px 10px;
color: #FFF;
}
This isn't something you can fix. If the text has to look perfect in every browser on every OS, use an image.
<ul id="LinkContainer">
<li class="=Link">
Variable Length Text A
</li>
<li class="=Link">
Variable B
</li>
<li class="=Link">
Variable Length Text C Really Long
</li>
<li class="=Link">
Var D
</li>
</ul>
.Link a {
background-image:url(title_sprite.png);
background-repeat:no-repeat;
height:40px;
text-indent:-999em;
}
.Link a.var_a {
background-repeat:no-repeat;
background-position:0 0;
width:200px;
}
.Link a.var_b {
background-repeat:no-repeat;
background-position:0 -45px;
width:150px;
}
.Link a.var_c {
background-repeat:no-repeat;
background-position:0 -90px;
width:75px;
}
.Link a.var_d {
background-repeat:no-repeat;
background-position:0 -135px;
width:90px;
}