CSS issue with a Background Image [closed] - css

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to add a background image to my site-header. Part of the image should be covered by the main-content.
It is positioned correctly however even though I've added z-index, the main content doesn't cover the background image.
Here is the website.
Why would that be?
Thanks!
Edit:
If you look on the right side you will see the brown egg is not covered by the main content. You can still see part of it.
Here is some code:
.header-navigation.back {
z-index:-1;
position:absolute;
margin-left:0;
margin-top:-6px;
border:none;
display:block; height:137px; width:1171px; padding:0px; outline:none; text-indent:-9999px;
background-image:url('http://frenchegg.com/images/backmenu.png');
}
and here is the main content that should cover the image:
.main-content {
z-index:99;
position:relative;
padding:1em 0 8.5em 0;
background:#fff;
}

please add the overflow:hidden css to the header-wrap class
.header-wrap {
...
overflow: hidden
...
}
and it should look good.
For the log in issue:
remove the z-index: 99999 from the class .bann
and add this css to the class tooltip-wrap
sorry something went wrong
Thanks

Seems like you could just reduce the height of the header-navigation.back rule to 100px rather than mess with z-index.

I changed the bann class to :
.bann {
cursor: pointer;
display: block;
height: auto;
position: relative;
width: 101.5%;
z-index: 99999;
margin-left: 12px;
}
after that it seems ok ... check it and inform me of the result;
I tested the code above with firebug ;)

Related

100vh doesn't take whole screen [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I want to create a one-scroll-page, like each section is full height from screen.
But when I use 100vh, it doesn't take whole screen height, but more like 95%.
Adding the code below to your CSS should fix it:
html,body{
margin:0;
}
This is caused by the default margin being 8px so redefining it using CSS will correct it.
Illustration with margin Set:
#Orange{
height:100vh;
width:100vw;
background:orange;
}
body{
margin:0;
padding:0;
}
<div id="Orange"></div>
Without the margin:0 adjustment:
#Orange{
height:100vh;
width:100vw;
background:orange;
}
body{
padding:0;
}
<div id="Orange"></div>
EDIT
Adding this code should adjust the margins for your container.
.container-fluid{
margin-top: 0;
margin-bottom: 0;
}

CSS Color the container [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am new to this language so I want to know how I can color the container (the part between header and footer). Is it possible without using div? I have tried this, but problem is that when I change the position of the container to "absolute" it overlaps the header more over changes the page's width Please give an example code. Thanks.
html , body {
height: 100%;
}
body {
background: red;
}
I made html and body 100% just in case. You probably don't need it. But I suggest that you never have a naked body as your background.
EDIT : Or if you want an image
body {
background:url('http://www.planwallpaper.com/static/images/canberra_hero_image.jpg');
}
https://jsfiddle.net/xqxrmm96/1/
html-
<html>
<body>
<header></header>
<section></section>
<footer></footer>
</body>
</html>
css-
header {
height: 30px;
background-color: #e0e0e0;
}
section {
height: 60px;
background-color: #efefef;
}
footer {
height: 30px;
background-color: #e1e1e1;
}
you can do it something like this

How to change the Img tag src through css only? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can I replace the image tag src value through css ? and i want support in ie8 ,firefox ,chorme,safari
<div class="any">
<img src="images/i.png"/>
</div>
replace this src value through css only.
Thanks
try setting a background image and then moving (with padding) out of the box the original image
something like this...
EDIT i had to tweak it a bit to have it working...
.any img {
display: block;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: url(http://placehold.it/150) no-repeat;
width: 150px;
height: 150px;
padding-left: 150px;
}
... and here is the working example
http://jsfiddle.net/nNaRn/1/
You can't change the src tag of the image with CSS, because the image src is nothing to do with CSS.
The closest you can do is set the background image of the div and get rid of the img tag altogether:
.any {
background-image: url('images/myimage.png');
}
Beyond this, you will need to use Javascript.
You cannot change the src through CSS. Although what you can do is define a blank div, and give it a width, height, and background-image through CSS. The only drawback with that approach is that the element will not behave like an image for the user (drag/drop, rightclick to save, etc.).
div.any {
width: 200px;
height: 200px;
background-image: url('./some-url-that-you-can-override-by-another-stylesheet');
}
The only thing that you can do is to set background-image to .any and display:none to img but you will need to set also width and height of the div, since div without content have width of 100%, and height of 0.
.any {
width: 300px;
height: 300px;
background-image: url(image/1.gif);
}
.any img {
display: none;
}

Div Positioning follows the other div [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Having a little problem with the comment part on the website i'm working on:
http://whybaguio.com/php/profile/businessprofile.php?id=103#
See how the ADD YOUR OWN FEEDBACK! div goes down together with the Facebook comment. I don't know how to not let it go down with the facebook comments.... Lol, I'm not really sure if I'm explaining my self right but I hope you guys get it...
I tried positioning it relative and absolute but it goes out of its parent div....
Please help me out, thank you!
Okay, this is a problem with how to use position:absolute; What you need to do is change your code like this:
#feed {
background: white;
height: 280px;
padding: 10px;
margin-top: 295px;
overflow-y: auto;
margin-left: -580px;
position: relative;/*this needs to have a position for .secondcomment to 'hook on' to*/
}
.secondcomment {
position: absolute;
top: 10px;
right: 0;
}
If i understand it right: place the "ADD YOUR OWN FEEDBACK" div before the "Facebook comment" div in your HTML code.
Your "ADD YOUR OWN FEEDBACK" div has a "float: right" property and blocks with "float" should go before non-floating blocks.
You can set float: left; property to .fb-comment class, and remove margin-left property from .secondcomment class.

I have a css style but the alignment is fixed in chrome but not in firefox [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
The below css coding is used in my page. But in chrome it displays the image fine. but in firefox it breaks. I dont know why it shows like that. If anybody know the solution for this please help me. Thanks in advance.
.vote
{
position:absolute;
margin: 53px 3px 0 115px;
}
http://domian.com/mysite/pollpage.php?id=2&mview=72
This is my website page. The vote image alignment is correct in chrome but not in firefox
add position relative
.contentbox
{
position: relative;
}
and remove margin ,
add bottom and right
.vote {
position: absolute;
bottom: 0;
right: 45px;
}
...
Now define your main div #polling .pollpagewidth div .contentbox position relative and give to img tag position absolute and define right or bottom value according to your design
Hi now add this css in your style sheet and fixed this problem
#polling .pollpagewidth div .contentbox{
position:relative;
}
.contentbox > img {
bottom: 16px;
margin: 0;
padding: 0;
position: absolute;
right: 43px;
}

Resources