I have a page top containing two menus. The problem is that when one of the submenus is unwrapped, it doesn't show (the other menu covers it). I've tried with z-index but it doesn't work. Thanks in advance.
The page and the code are avaliable in http://infoglobal.eu1.frbit.net/En/cap.php.
Your html and CSS is messed up a bit
#top{
z-index:13 //This is not needed
}
.menu{
z-index: 10 //This is also not needed
}
#canvi_idioma{
z-index:1 //Simply add this
}
You can use z-index with position.
css example
.Class{
position:relative; //You have to choose atleast one position type.
z-index:100; // value can be change according to you .
}
Apply z-index to #canvi_idioma
CSS
#canvi_idioma{
z-index:9999
}
In your css you use z-index on '.menu' but that affects both menus. You have to apply it to #menu and #canvi_idioma.
Also note that z-index only works when both elements are within the same parent node.
Also your code is kinda dirty. You may want to clean up things like this with position beeing in there two times:
#canvi_idioma {
background: transparent;
position: absolute;
right: -95%;
top: 40px;
position: relative;
}
You only need this.
.menu {z-index:100}
Related
I'm not sure what in the CSS is causing the * to display below the textbox when I add the class tiny to the div
<div class="editor-field tiny required-indicator">
Check out the jsfiddle: https://jsfiddle.net/pfqqmmfn/
If the class tiny is removed then the * display after the textbox like expected. I'm still learning CSS so any help would be great. I know it has to be something simple but I can't find the issue.
Thanks for any help.
I updated your JSFiddle: https://jsfiddle.net/pfqqmmfn/2/
I changed .required-indicator:after (the little asterisk) to this:
.required-indicator:after
{
content: "*";
display:block;
font-weight: bold;
color: Red;
width:20px;
height:20px;
position:absolute;
left:calc(100% + 10px);
top:0;
}
And added position:relative; to your .tiny class.
Relative position to the parent (.tiny) lets me use position:absolute on its :after pseudo-element (which behaves as its child).
You had your asterisk pseudo-element on position:relative; so by giving that item the .tiny class, you set its width to 135px (with !important, too) thus stopping the little asterisk from fitting in there.
If you add this
form div.tiny {
width: 120px !important;
}
it overwrites the built-in rule that causes your problem (making the input field containers too narrow to allow the asteriks next to it). You can try and use different width settings.
https://jsfiddle.net/zLoqy3py/
Just like the Title says, "How to use text as a background instead of an image?"
I'm making a little application, that I personally think is cool but will probably be a waste of peoples time, and am altering the button in the drop down button to an upside down triangle using this html code ▼ . I'm not talking about setting the z-index or anything just simply placing a character for the little arrow. I thought about leaving it blank but I don't think users would understand that they are supposed to use the menu if I did so. Therefore I'm going to use the upside down triangle.
My CSS for the drop-down list is set up like this
select {
border: none;
overflow: hidden;
background: no-repeat right #ffffff;
-moz-appearance: none;
-webkit-appearance: none;
text-indent: 0.01px;
text-overflow: '';
}
Put the text inside an HTML tag with class .text-background, set CSS styles to
.text-background {
position: absolute;
z-index: 1;
}
and set z-index to the elements you want to be on top of the text with z-index higher than 1.
edit:
If you know what the size of the select element is, you probably want to position that text over the dropdown. This however will block the button.
JSFiddle
If you want better looks and functionality you can use a 3rd party libraries such as this or this.
edit 2:
I just found this CSS only solution given by Danield that's probably going to suite your needs better.
https://stackoverflow.com/a/13968900/1419575
Try This, as suggested by Paulo Bergantino:
JS Fiddle
Click Here
HTML
<div id="container">
<div id="background">
Text to have as background
</div>
Normal contents
</div>
CSS
#container{
position: relative;
}
#background{
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: -1;
overflow: hidden;
}
im having a problem when im trying to create a dropdown.(See JSfiddle) The navigation menu is going from side to side when im hovering over it.. I have not seen any other placed that can solve my problem :/
JSfiddle: http://jsfiddle.net/kavqc/2/
I think the problem is here a place:
.dropdown {
position:absolute;
top:62px;
left:0;
visibility:hidden;
background-color: red;
}
PS: sry for my bad English
as #KevinJantzer mentioned - fix the jump by changing margin-left.
Fix the menu positioning by adding position: relative to your .li class:
.li {
display:inline-block;
position: relative;
list-style:none;
}
Demo
The reason the menu jumps to the right is because of the margin-left style:
.navbar-menu:hover {
...
margin-left: 200px; // remove this
...
}
Here is your jsFiddle with the margin-left removed: http://jsfiddle.net/kavqc/3/
This image is a screenshot of the address http://www.rothemcollection.com/engagement-rings/.
The 's' of 'Recommendations' cut by Google Chrome browser. I tried to change the z-index, move it down with the top or margin-top and it still cuts me to the end.
Does anyone have an idea? It could be related to poor I use a special font? If so, what should I do?
Try this css :
#mainSlider h1 span.big {
font-size: 60px;
line-height: 63px;
display: inline-block;
width: 484px;
position: relative;
}
Define your mainSlider Heading position:relative; or define z-index:1;
As like this
#mainSlider h1{
position:relative;
z-index:1;
}
Result is
There is issue, most likely it is related to opacity and css engine rendering, supposely because of some optimization. I would suggest more the header to left by 6 pixels to avoid overlapping of images to it, something like this.
#mainSlider h1 {
left: -6px;
position: relative;
...
There's a few ways to do this - I'll add my view to the mix. Try adding z-index:-1; to the .ring class. This will produce problems if you want to make the images links at some point, but should work in your current setup.
#mainSlider .ring{
position: absolute;
right: 0;
z-index:-1;
}
I reduced the text size by one pixel and problem solved.
Not a suboptimal solution but still works. Unfortunately, the solutions did not help.
Thank you all.
I am developing for an existing web application on an internal server, I can't really post all the code here as it's very very messy but I can show you guys a screenshot of the problem and the relevant css code:
The languages menu should be on top of the blue bordered box, but instead it's beneath.
It works great in FF, this is a IE7 screenshot
blue bordered box css:
.categoryBox {
width:100px;
background-color:#000;
border-style:solid;
border-width:1px;
border-color:#007CF7;
padding:5px;
float:left;
height:260px;
margin-right:25px;
margin-bottom:20px;
text-align:center;
width:200px;
position:relative;
}
language menu css:
#ChooseLanguageDlg
{
display: none;
position: absolute;
width: 87px;
height: 180px;
padding-left: 10px;
padding-right: 10px;
padding-top:0;
margin-top: -9px;
border: none 1px White;
left: 751px;
top: 10px;
font-size:11px;
overflow:hidden;
text-align:center;
}
Note: the languages menu is using a javascript toggle to show/hide.
EDIT:
Adding z-index to the language box does not change the visibility in IE
IE7 has known problems with z-index. Without seeing your page, the best I can do is point you to some useful links which explain the problem:
http://brenelz.com/blog/squish-the-internet-explorer-z-index-bug/
IE7 Z-Index Layering Issues
http://richa.avasthi.name/blogs/tepumpkin/2008/01/11/ie7-lessons-learned/
The general idea is to poke position: relative (usually remove it) and z-index on parent elements of your drop down until it's fixed.
Good luck!
Setting the z-index of the language box manually may help. Of course, if you don't want to do this, putting the language box after the blue box in the markup will do the trick too.
You could try adding a z-index. This'll define which element is on top of which element:
z-index
add a z-index to the style for the language box?
IE has some problem with z-index (see Google). As I had to fix a similar problem I was forced to use javascript to hide the background elements, which isn't really suitable for you.
You could try to change the order of creation in the html code, if possible.