CSS grid background image full size - html

Hello how can I make half1/half2 background image to start at the end of the bootstrap navbar and end at the bottom of the page making no side scroll bar available on any resolution.
I tried with different methods,like making the body and html 100% height and play with content and navbar % or using the vh measure unit,I cant figure it out what is the issue,thank you.
Github: https://github.com/cotrutatiberiu/WW2
Site: https://cotrutatiberiu.github.io/WW2/nations/nations/us.html
Html path: WW2/nations/nations/us.html
Css path: WW2/css/nationscss/us.css
PS:Grid might be broken,i'm learning it

it is a little bit hard, because your layout not support it. But if you take both images and use some photo editor (photoshop or something) to merge them to only one image, it can help. Than you will use your new image on body background-image and use background-size: cover;. Be careful, other elements have to have transparent background.

Related

HTML/CSS Background feature how can i do this

i've been trying to find the name of this but i have no clue on how is this called and made.I have been coding a html website and i wanted to do some experimenting with the background that there is Content on a white background(the white background is small just to cover the content not a main background) and behind it, is the background image. Check steam profile backgrounds everything is on the blue/black background and the games bgs are behind.
Sorry for my bad english.
I think to have understood your questione, in css make the body, or a background DIV height and width :100% than set the background-image: imagepath;
Now your should have the background.
than create a div, in CSS make it position: relative; height and width the size do your preferenze than to have it centered use matgin:auto; and to have only the background of the div look semi trasparente use a background-color:rgba(255,255,255,0.8)
I hope to have answered your question.
PS if your need to get started try Code accademy.

Slider width and height without stretching

I'm working on a website for a friend of mine. There's only one problem. The slider won't fit in the frame without stretching.
I've set it to 100% height, but it won't work out. (Its also responsive)
I want it to be a nice image in the original width and height (100x100, 200x200 etc) without stretching (200x500).
I hope you guys can help me out on this.
I'd tried alot and also asked some other people but they can't help me with this.
You can see the slider over here.
http://tinyurl.com/p36hz6u
Here's another version of the slider, but on this version the slider image gets cut off
http://tinyurl.com/nfjjvwu
If the images are background images, consider using the background-size:contain; which will allow the image to grow as large as visible/possible without stretching, and then you can position the background image wherever desired with background-position
If the slides have actual physical <img /> tags, I made a JSfiddle that demonstrates code that will contain an image within an element. In this example, the <div> tags represent a browser window and can be resized: http://jsfiddle.net/dds27w2y/
Firstly what I would do is to remove the: background-size: 100% 100% and add a background-position: center center.
Then I would add a background-color: white to the container. This would make it look nicer and it would be centered.

Make a 'width: 100%' image placed below navigation become a background of navbar on mobiles

If you look at what happens here when you reduce the screen width is that the big photo becomes shorter and shorter, still filling in the full 100% of the width:
https://mmistakes.github.io/minimal-mistakes/
Now, I don't find that appealing and would like to make that photo disappear and become a background of the whole top (navbar) part once the navigation bar becomes the button. However, I would like only a certain part of the photo to show up, not the whole width.
Any hints on how to achieve that?
Update: the tricky part here is that each page has its own image. Since this is jekyll, in theory, I could add a css entry in the <head> of each generated page for setting the background image of the navbar, but I'm not sure whether there is a more elegant solution.
Put the picture as a background for your nav-bar and use the css background-position attributes.
Use viewport and let the image (the img-tag) disappear

Menu and Text over a banner image, responsive

I'm creating a webpage but I am having some problems with responsiveness.
Right under my logo, there is a large image. (1000 by 550 px) Over that image, I want to place a menu - and I think I've worked that out with position: absolute. However, I want to use an introduction text, and I cant figure out how to do that.
Could I just use a TextBox with absolute and z-index? Otherwise, how can I add the image as a background image and make it responsive?
background-size: 100%;
That would make your background image responsive. But only if the container itself is responisve though. A more exact answer would require a fiddle or at least some html and css.

css gradiant background long page

I have a a background image on my html with css page, from blue at the top, to white at the bottom.
However, the image 400x800 and the page is much longer, so it repeats.
The page length varies all the time.
Is it possible to solve this so the background stretches to the page length somehow? or maye make it not repeat and make the background white with the image on top?
If yes, how please?
The easiest is to set the image to not repeat and then set the background color the same as one end of the gradient:
body {
background: white url('yourImage') repeat-x top left;
}
Getting a gradient to stretch to fit the window is doable, but is more work and would require some javascript.
I know that there are jQuery / Javascript methods of accomplishing this:
Resizable Backgrounds with jQuery
Stretch background image - jQuery - Demo
but besides resorting to solutions like those - you could:
Select a pattern for your background that repeats (textures etc.)
Create a very long background image that could handle most navigation that your page
would deal with.
Another alternative is to make your gradient the same at both ends with the maximum colour difference at the 50% mark.