Translucent nav bar with background image behind: css, no javascript [closed] - html

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 8 years ago.
Improve this question
Bit of a newbie, but trying to do something i thought would be quite simple; i'd like a full screen background image with no margins, that scales to screen size (i'm using background: cover; at the moment) but I'd like to put a translucent nav bar over the top of the image right at the top, containing a horizontal menu.
So far, I have the nav bar, but the image is sitting either above the nav bar, or underneath it, instead of directly on top. What's the best way of doing this, is it z-index values, or is there something easy i should be doing to place one div (.nav) over another (.background-img)?
any help much appreciated, sorry if this is a bit vague but i am a total newcomer to html & css!!

Try using position:fixed; if you're not already. Do something like this:
div.background-img {
background-image: url('background.png');
margin: 0;
padding: 0;
position: fixed;
top: 0;
left:0;
right:0;
bottom:0;
background-size:cover;
}
div.nav {
position: fixed;
background: rgba(255, 255, 255, 0.7);
top: 0;
left: 0;
right:0;
padding: 16px;
}
See a demo here

Related

Responsive stuck div on website entry [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I can't seem to find the exact answer I'm looking for online, but the problem is that I'm not even sure what to look for.
When you enter the homepage, I want a div to be stuck to the bottom (for any device) and when you scroll. But I do not want it fixed so that it scrolls with the screen.
I'm sure this is some responsive trick that I'm overlooking, but I'd love some feedback. Thank you in advanced!
EDIT: I do not want the div to follow you upon scrolling. But I do want it to appear to the very bottom of the screen when you first view the site (no matter the platform you are using to view the site.)
Example is this site. The down arrow appears in the same spot for all devices, but does not scroll with the user: https://www.nabitablet.com/
You might be able to use an absolutely positioned container sized to the window, then absolutely position the item to the bottom of that. Depending on your page structure, this might not work.
body {
height: 5000px;
}
.container {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.item {
background-color: #f00;
bottom: 0;
height: 50px;
position: absolute;
width: 100%;
}
<div class="container">
<div class="item"></div>
</div>

div height and overflow [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 7 years ago.
Improve this question
On this template: GYM
If I add add more text under the welcome title, the form is lowered down and then disappears (class .home has overflow: hidden).
If I make it visible then will be over the section under it. What I want is the div's height to be modified depending on the text that I add, to show all the content and then start the other section (w/o a scroll for the div -> overflow: scroll)
Thanks!
Make the form position:relative; and the carousel position:absolute; (with extra positioning).
This will make sure the height will adjust, but still allow the carousel to flow in the background.
Edit (this is what I used):
.home form {
background-color: rgba(0,0,0,0.3);
height: 100%;
padding-top: 150px;
position: relative;
width: 100%;
z-index: 90;
}
.carousel {
position: absolute;
top: 90px;
left: 0;
width: 100%;
}

Bootstrap button to bottom [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 7 years ago.
Improve this question
How to place the Scroll button to the bottom of the first page?
Using bootstrap code and not using extra CSS.
Example site
This is what I mean:
you can use position fixed? that would keep it at the bottom of the page
button{
position:fixed;
bottom:20px;
}
https://jsfiddle.net/Lf5o705a/
or position absolute would keep it at the bottom of the first section
button{
position:absolute;
bottom:20px;
}
https://jsfiddle.net/Lf5o705a/1/
I don't think bootstrap has anything built-in for this.
If you want to write some css, consider the following example:
HTML:
<div class="outside">
<div class="inside"></div>
</div>
CSS:
.outside {
height: 300px;
background-color: #eee;
position: relative; /* This allows you to position something absolutely within this element. */
}
.inside {
height: 50px;
width: 100px;
background-color: #ccc;
display: inline-block;
position: absolute; /* This allows you to specify the position within the parent element */
bottom: 10px; /* will be located 10px from the bottom of 'outside' */
/* This is a method for centering an absolutely positioned element */
left: 50%;
margin-left: -50px; /* Half of the width, so that it can be centered
}
Example fiddle

Trying to get slider to stay within background image border and still remain responsive [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 7 years ago.
Improve this question
I have been trying(very hard)to get this slider to remain inside the black area of the background image. I can do it if I set all the widths etc. to fixed values but
then the page is no longer responsive. When I try using percentages everything scales with the browser but the slider jumps around...Mock up is running at:
http://www.skaliwag.com.au
Hello i think i fixed your problem.
It's very simple. You just need to change two values in your css: the .rslides margin to 65% auto and remove the margin-top of the image. Then it should look like this.
The slider div:
.rslides {
position: relative;
list-style: none;
overflow: hidden;
width: 70%;
padding: 0M
margin: 65% auto;
}
and the image:
.rslides img {
float: none;
display: block;
height: auto;
width: 100%;
border: solid 1px;
border-radius: 10px;
position: relative;
}
Hope it was helpfull :)

HTML & CSS: Split page horizontally with vertical scrollbars [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 8 years ago.
Improve this question
I can't find how to do something that should be very simple. I want to divide page to two panes horizontally. Between the panes there's some border (wheter it can be resized or not I don't care). The upper pane can scroll vertically, while the lower pane stay fixed.
I tried bootstrap sticky fixed footer, but I don't have scroller for top part there.
My eventual goal is to insert all kind of links in bottom fixed pane that will help navigating to places in the top pane.
Thanks in advance
Here is an option where your elements will take whole screen. If you want to limit their size to bootstrap container you need to put them in container and give it style of position:relative
<div class="upper">This will scroll</div>
<div class="lower">This will not</div>
.upper, .lower {
position: absolute;
left: 0;
right: 0;
}
.upper {
top: 0;
height: 50%;
background-color: pink;
overflow:scroll;
}
.lower {
bottom: 0;
height: 50%;
background-color: blue;
}
Fiddle: http://jsfiddle.net/jGBh3/