Solved

CSS question: how to stretch an image to full screen width

Posted on 2015-02-20
3
83 Views
Last Modified: 2015-02-20
I've been having trouble with this one. I need to stretch an image to the full width of a screen, no matter what screen resolution. I am pretty sure I can do that with CSS.

Here is the web site: http://www.leafyhead.com/

In the header area you can see the logo image. I'd like to stretch that image to whatever the width of the screen is.

Does the image need to be a background image?

Is there a CSS style that will do what I need?

Thanks as always for your help.

Eric
0
Comment
Question by:Eric Bourland
  • 2
3 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 40621604
Just use background-size:cover for the CSS of the element where you are using it.

Cd&
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 40621613
Got it. I was looking for that. =) I'll go try it now. Thank you!
0
 
LVL 3

Author Closing Comment

by:Eric Bourland
ID: 40621701
Thanks for pointing this out to me. =)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change javascript css 1 30
Target h5 of a div 3 18
Place text over image using CSS 6 44
Create tabs to show divs 9 31
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question