how to set background image full height-width in large screen?2019 Community Moderator ElectionHow to make a div 100% height of the browser window?How do I combine a background-image and CSS3 gradient on the same element?How can I transition height: 0; to height: auto; using CSS?Get responsive background-image height?Absolutely positioned DIV's width not resizing based on child imageResponsive background-imageCSS two stacked background images in divs, 100% width 50% heightContainer DIV stretches when resizing but not when scrollingBackground image responding to heightHow to deal with background images with 100% width and height in mobile and tab screens?
Where is the fallacy here?
What is Tony Stark injecting into himself in Iron Man 3?
In the world of The Matrix, what is "popping"?
Is divide-by-zero a security vulnerability?
School performs periodic password audits. Is my password compromised?
The (Easy) Road to Code
Should we avoid writing fiction about historical events without extensive research?
Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?
How to make sure I'm assertive enough in contact with subordinates?
Can you run a ground wire from stove directly to ground pole in the ground
Is there a way to find out the age of climbing ropes?
Why are special aircraft used for the carriers in the United States Navy?
Why is there an extra space when I type "ls" on the Desktop?
I can't die. Who am I?
What is "desert glass" and what does it do to the PCs?
How spaceships determine each other's mass in space?
Short story about an infectious indestructible metal bar?
Does the in-code argument passing conventions used on PDP-11's have a name?
Is this nominative case or accusative case?
Gemara word for QED
Using the imperfect indicative vs. subjunctive with si
Should I use HTTPS on a domain that will only be used for redirection?
Is there such a thing in math the inverse of a sequence?
Does the US political system, in principle, allow for a no-party system?
how to set background image full height-width in large screen?
2019 Community Moderator ElectionHow to make a div 100% height of the browser window?How do I combine a background-image and CSS3 gradient on the same element?How can I transition height: 0; to height: auto; using CSS?Get responsive background-image height?Absolutely positioned DIV's width not resizing based on child imageResponsive background-imageCSS two stacked background images in divs, 100% width 50% heightContainer DIV stretches when resizing but not when scrollingBackground image responding to heightHow to deal with background images with 100% width and height in mobile and tab screens?
- i was put .svg file as background image.
- in small screen it was ok, but when i show in large screen it was cut from top and bottom
- i want to show background image in full height/width as original size in large and all screen
demo image
-here is my code
.bg
width: 100%;
height: 540px;
background-image: url(http://inheritxdev.net/Design-Projects/perfit_home/images/OnePager-Header.svg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
float: left;
width: 100%;
border: 1px solid red;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
</style>
</head>
<body>
<p>Resize the browser window to see the effect.</p>
<div class="bg"></div>
</body>
</html>
html5 css3 responsive-design
add a comment |
- i was put .svg file as background image.
- in small screen it was ok, but when i show in large screen it was cut from top and bottom
- i want to show background image in full height/width as original size in large and all screen
demo image
-here is my code
.bg
width: 100%;
height: 540px;
background-image: url(http://inheritxdev.net/Design-Projects/perfit_home/images/OnePager-Header.svg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
float: left;
width: 100%;
border: 1px solid red;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
</style>
</head>
<body>
<p>Resize the browser window to see the effect.</p>
<div class="bg"></div>
</body>
</html>
html5 css3 responsive-design
add a comment |
- i was put .svg file as background image.
- in small screen it was ok, but when i show in large screen it was cut from top and bottom
- i want to show background image in full height/width as original size in large and all screen
demo image
-here is my code
.bg
width: 100%;
height: 540px;
background-image: url(http://inheritxdev.net/Design-Projects/perfit_home/images/OnePager-Header.svg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
float: left;
width: 100%;
border: 1px solid red;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
</style>
</head>
<body>
<p>Resize the browser window to see the effect.</p>
<div class="bg"></div>
</body>
</html>
html5 css3 responsive-design
- i was put .svg file as background image.
- in small screen it was ok, but when i show in large screen it was cut from top and bottom
- i want to show background image in full height/width as original size in large and all screen
demo image
-here is my code
.bg
width: 100%;
height: 540px;
background-image: url(http://inheritxdev.net/Design-Projects/perfit_home/images/OnePager-Header.svg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
float: left;
width: 100%;
border: 1px solid red;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
</style>
</head>
<body>
<p>Resize the browser window to see the effect.</p>
<div class="bg"></div>
</body>
</html>
.bg
width: 100%;
height: 540px;
background-image: url(http://inheritxdev.net/Design-Projects/perfit_home/images/OnePager-Header.svg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
float: left;
width: 100%;
border: 1px solid red;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
</style>
</head>
<body>
<p>Resize the browser window to see the effect.</p>
<div class="bg"></div>
</body>
</html>
.bg
width: 100%;
height: 540px;
background-image: url(http://inheritxdev.net/Design-Projects/perfit_home/images/OnePager-Header.svg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
float: left;
width: 100%;
border: 1px solid red;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
</style>
</head>
<body>
<p>Resize the browser window to see the effect.</p>
<div class="bg"></div>
</body>
</html>
html5 css3 responsive-design
html5 css3 responsive-design
edited yesterday
dhrupal suthar
asked yesterday
dhrupal suthardhrupal suthar
183
183
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Think it has to do with the background-size.
Maybe this works better for you? (practically the same, btw if contain
isn't what you want try cover
.
background-size: contain;
background-repeat: no-repeat;
background-position: center;
could you prehaps show what you want with an image.
New contributor
i try that but image not show in full width
– dhrupal suthar
yesterday
Ah that's because it tries to compensate for the width and height based on the parameters set... But do you want to have it always 100% width but strech/squash the image in the height or not?
– Ryan van den Bogaard
yesterday
1
you could prehaps use something like this if you want to use cover to keep 100% width but keep the height filled and the picture aligned from the top. ` background-position-y: top; background-size: cover;`
– Ryan van den Bogaard
yesterday
please share your code. i can't understand what you talking about.
– dhrupal suthar
21 hours ago
i put that background-position-y: top; background-size: cover; ,but now image crop from bottom.
– dhrupal suthar
2 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023323%2fhow-to-set-background-image-full-height-width-in-large-screen%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Think it has to do with the background-size.
Maybe this works better for you? (practically the same, btw if contain
isn't what you want try cover
.
background-size: contain;
background-repeat: no-repeat;
background-position: center;
could you prehaps show what you want with an image.
New contributor
i try that but image not show in full width
– dhrupal suthar
yesterday
Ah that's because it tries to compensate for the width and height based on the parameters set... But do you want to have it always 100% width but strech/squash the image in the height or not?
– Ryan van den Bogaard
yesterday
1
you could prehaps use something like this if you want to use cover to keep 100% width but keep the height filled and the picture aligned from the top. ` background-position-y: top; background-size: cover;`
– Ryan van den Bogaard
yesterday
please share your code. i can't understand what you talking about.
– dhrupal suthar
21 hours ago
i put that background-position-y: top; background-size: cover; ,but now image crop from bottom.
– dhrupal suthar
2 hours ago
add a comment |
Think it has to do with the background-size.
Maybe this works better for you? (practically the same, btw if contain
isn't what you want try cover
.
background-size: contain;
background-repeat: no-repeat;
background-position: center;
could you prehaps show what you want with an image.
New contributor
i try that but image not show in full width
– dhrupal suthar
yesterday
Ah that's because it tries to compensate for the width and height based on the parameters set... But do you want to have it always 100% width but strech/squash the image in the height or not?
– Ryan van den Bogaard
yesterday
1
you could prehaps use something like this if you want to use cover to keep 100% width but keep the height filled and the picture aligned from the top. ` background-position-y: top; background-size: cover;`
– Ryan van den Bogaard
yesterday
please share your code. i can't understand what you talking about.
– dhrupal suthar
21 hours ago
i put that background-position-y: top; background-size: cover; ,but now image crop from bottom.
– dhrupal suthar
2 hours ago
add a comment |
Think it has to do with the background-size.
Maybe this works better for you? (practically the same, btw if contain
isn't what you want try cover
.
background-size: contain;
background-repeat: no-repeat;
background-position: center;
could you prehaps show what you want with an image.
New contributor
Think it has to do with the background-size.
Maybe this works better for you? (practically the same, btw if contain
isn't what you want try cover
.
background-size: contain;
background-repeat: no-repeat;
background-position: center;
could you prehaps show what you want with an image.
New contributor
New contributor
answered yesterday
Ryan van den BogaardRyan van den Bogaard
214
214
New contributor
New contributor
i try that but image not show in full width
– dhrupal suthar
yesterday
Ah that's because it tries to compensate for the width and height based on the parameters set... But do you want to have it always 100% width but strech/squash the image in the height or not?
– Ryan van den Bogaard
yesterday
1
you could prehaps use something like this if you want to use cover to keep 100% width but keep the height filled and the picture aligned from the top. ` background-position-y: top; background-size: cover;`
– Ryan van den Bogaard
yesterday
please share your code. i can't understand what you talking about.
– dhrupal suthar
21 hours ago
i put that background-position-y: top; background-size: cover; ,but now image crop from bottom.
– dhrupal suthar
2 hours ago
add a comment |
i try that but image not show in full width
– dhrupal suthar
yesterday
Ah that's because it tries to compensate for the width and height based on the parameters set... But do you want to have it always 100% width but strech/squash the image in the height or not?
– Ryan van den Bogaard
yesterday
1
you could prehaps use something like this if you want to use cover to keep 100% width but keep the height filled and the picture aligned from the top. ` background-position-y: top; background-size: cover;`
– Ryan van den Bogaard
yesterday
please share your code. i can't understand what you talking about.
– dhrupal suthar
21 hours ago
i put that background-position-y: top; background-size: cover; ,but now image crop from bottom.
– dhrupal suthar
2 hours ago
i try that but image not show in full width
– dhrupal suthar
yesterday
i try that but image not show in full width
– dhrupal suthar
yesterday
Ah that's because it tries to compensate for the width and height based on the parameters set... But do you want to have it always 100% width but strech/squash the image in the height or not?
– Ryan van den Bogaard
yesterday
Ah that's because it tries to compensate for the width and height based on the parameters set... But do you want to have it always 100% width but strech/squash the image in the height or not?
– Ryan van den Bogaard
yesterday
1
1
you could prehaps use something like this if you want to use cover to keep 100% width but keep the height filled and the picture aligned from the top. ` background-position-y: top; background-size: cover;`
– Ryan van den Bogaard
yesterday
you could prehaps use something like this if you want to use cover to keep 100% width but keep the height filled and the picture aligned from the top. ` background-position-y: top; background-size: cover;`
– Ryan van den Bogaard
yesterday
please share your code. i can't understand what you talking about.
– dhrupal suthar
21 hours ago
please share your code. i can't understand what you talking about.
– dhrupal suthar
21 hours ago
i put that background-position-y: top; background-size: cover; ,but now image crop from bottom.
– dhrupal suthar
2 hours ago
i put that background-position-y: top; background-size: cover; ,but now image crop from bottom.
– dhrupal suthar
2 hours ago
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023323%2fhow-to-set-background-image-full-height-width-in-large-screen%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown