I'm new on Stackoverflow, and i need help with these problem.
So the problem is: I want this dashed image height to 100% of the container.
HTML
<div id="test1">
</div>
<aside>
<?php
if (logged_in() === true) {
include 'includes/widgets/loggedin.php';
} else {
include 'includes/widgets/login.php';
}
include 'includes/widgets/user_count.php';
include 'includes/widgets/sponsors.php';
include 'includes/widgets/partners.php';
?>
</aside>
CSS
aside {
width:260px;
float:right;
background-image:url(../images/dashed.png);
background-repeat: repeat-y;
padding-left:15px;
}
#container, footer {
background:#fff;
width:1100px;
margin:0 auto;
padding:20px;
}
#test1 {
height:1000px;
}
Can anyone help me?
Try this:
aside {
background: url(images/bg.jpg) repeat-y center center fixed;
padding-left:15px;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Related
I'm a beginner in html and I am trying to use an image as a complete background to my page . I want the image to fit my sceen so that I do not have to scroll down to see the rest of the image. I have tried this but the image doesn't even load to begin with .
.html , .body{
margin:0;
height:100%;
}
#map{
background: url("HTML_FILES/IMAGES/map.jpg");
height:100%;
width:100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
<div id = "map"></div>
My folder structure is like :
PROJECT
HTML_FILES
mypage.html
IMAGES
map.jpg
I would appreciate your help with guiding me to load the image and adjust it correctly . Thank you in advance .
.html , .body{
margin:0;
height:100%;
}
#map{
background-image: url(https://images.unsplash.com/photo-1495567720989-cebdbdd97913?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80);
height:100%;
width:100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position:absolute;
top:0;
bottom:0;
}
<div id = "map"></div>
Use the below style to get it done.
body {
background: url(HTML_FILES/IMAGES/map.jpg);
height: 100%;
width: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
I have a problem stretching a specific image to fit its parrent div.
On chrome/fire this works great.
On IE(I am using 11) this image does not stretch to its container.
I tried every example out there.
Please look at my code from plunker:
https://plnkr.co/edit/KHbgUXjDc349RpPgcWV9?p=preview
<div class="cls-1">
<div class="cls-2"></div>
<div class="lp__box-shadow icon-login_shadow"></div>
</div>
.icon-login_shadow {
background: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20viewBox%3D%220%200%20503.17%20193.59%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bopacity%3A0.2%3Bmix-blend-mode%3Ascreen%3Bfill%3Aurl%28%23linear-gradient%29%3B%7D%3C/style%3E%3ClinearGradient%20id%3D%22linear-gradient%22%20x1%3D%22251.59%22%20y1%3D%22193.59%22%20x2%3D%22251.59%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%220.14%22%20stop-color%3D%22%232f343b%22%20stop-opacity%3D%220%22/%3E%3Cstop%20offset%3D%220.52%22%20stop-color%3D%22%23337082%22%20stop-opacity%3D%220.41%22/%3E%3Cstop%20offset%3D%220.85%22%20stop-color%3D%22%23369fb9%22%20stop-opacity%3D%220.73%22/%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2337b1cf%22%20stop-opacity%3D%220.85%22/%3E%3C/linearGradient%3E%3Csymbol%20id%3D%22login_box_mirror%22%20data-name%3D%22login%20box%20mirror%22%20viewBox%3D%220%200%20503.17%20193.59%22%3E%3Crect%20class%3D%22cls-1%22%20width%3D%22503.17%22%20height%3D%22193.59%22/%3E%3C/symbol%3E%3C/defs%3E%3Ctitle%3Elogin%20shadow%3C/title%3E%3Cg%20id%3D%22Layer_2%22%20data-name%3D%22Layer%202%22%3E%3Cg%20id%3D%22login_2%22%20data-name%3D%22login%202%22%3E%3Cg%20id%3D%22Login_background_window_copy%22%20data-name%3D%22Login%20background%20window%20copy%22%3E%3Cuse%20width%3D%22503.17%22%20height%3D%22193.59%22%20xlink%3Ahref%3D%22%23login_box_mirror%22/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E') no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
.lp__box-shadow {
margin-top: 0.5em;
height: 50px;
width:100%;
}
.cls-1{
width:50%;
}
.cls-2{
border: 1px solid red;
height:50px;
width:100%;
}
EDIT:
Who ever thinks its a duplicate, show it on the plunker, the "duplicate" not working in my case
use this:
background: url('url.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
i have a background image and i want to use it on my website but the problemn is i cant make it full height and width in any size, help me and please, check the codes below
current code, code #1 : haft and not full
body {
background: url(http://localhost/wordpress/wp-content/uploads/2016/11/CHRISTINE-BACKGOURND.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
/* background-size: cover; */
height: auto!important;
width: 100%!important;
}
code # 2
body {
background: url(http://localhost/wordpress/wp-content/uploads/2016/11/CHRISTINE-BACKGOURND.jpg) no-repeat center center fixed;
background-color: white;
background-size: auto 100%;
background-repeat: no-repeat;
background-position: left top;
}
i cant make it full width and height :( please help
html{
width:100%,height:100%;
}
body{
background-image: url(https://i.stack.imgur.com/s0G3w.jpg);
height:100%;
width:100%;
}
<body>
</body>
Please try this
HTML
<body></body>
CSS
html{
width:100%,height:100%;
}
body{
background: url(../image.jpg) no-repeat;
background-size:cover;
height:100%;
width:100%;
}
I am trying to center a div inside another div.
I have tried the following HTML and CSS
HTML
<div class="header">
<div class="homeImageText">
<h1>Document Preparation Like Never Before</h1>
</div><!--homeImagetext end-->
</div>
CSS
.homeImageText {
left:0; right:0;
top:0; bottom:0;
margin:auto;
max-width:100%;
max-height:100%;
}
header{
background: url(../images/header1.png) center center no-repeat; ;
height: 600px;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Live
jsfiddle
Demo Fiddle
For vertical centering, make the wrapping div set to display-table and the child to display:table-cell with vertical-align:middle. Horizontal centering can then simply be accomplished with text-align:center;
Try the CSS:
.header {
height: 600px;
display:table;
width:100%;
}
.homeImageText {
height:100%;
display:table-cell;
vertical-align:middle;
text-align:center;
}
When i choose a image to put as a background of my div i can't manage to make it look normal. The width and height of my header are made with em. Can someone explain me how i can get a image as a background at my header when the header is like: 120em width. 5em height. So i need to make a normal header background the size of my header.
.header{
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-image:url('images.jpg');
text-align: center;
width: 120em;
height:5em;
background-size:100%;
}
.left{
background-color:red;
float: left;
width: 20em;
height: 51em;
}
.middle{
background-color: green;
width:120em;
padding:0px;
margin:0px;
height:51em;
}
.footer{
height:4em;
width: 120em;
background-color: blue;
}
Check here, http://css-tricks.com/perfect-full-page-background-image/
DEMO http://jsfiddle.net/yeyene/PtEnY/3/
#yourHeader{
float:left;
width:120em;
height:5em;
background: url(images/bg.jpg);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.jumbo-background {
background: url(image/bg.jpg) no-repeat center/cover;
}
I think I understand what you are try to achieve, the above is what I use, just drop it on the highest level div where you want the background image and it should stay relatively "in frame" as the page scales. You way want to add a bit to this for compatibility but the above is the general gist.