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?










0















  • 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



in large screen



-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>












share|improve this question




























    0















    • 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



    in large screen



    -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>












    share|improve this question


























      0












      0








      0








      • 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



      in large screen



      -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>












      share|improve this question
















      • 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



      in large screen



      -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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday







      dhrupal suthar

















      asked yesterday









      dhrupal suthardhrupal suthar

      183




      183






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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.






          share|improve this answer








          New contributor




          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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.






          share|improve this answer








          New contributor




          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • 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















          0














          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.






          share|improve this answer








          New contributor




          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • 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













          0












          0








          0







          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.






          share|improve this answer








          New contributor




          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          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.







          share|improve this answer








          New contributor




          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer






          New contributor




          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered yesterday









          Ryan van den BogaardRyan van den Bogaard

          214




          214




          New contributor




          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Ryan van den Bogaard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.












          • 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











          • 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



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme