Solved

Full Width Image with CSS

Posted on 2014-12-09
3
220 Views
Last Modified: 2014-12-09
I feel really dumb but I cannot get my header image to be full width. I've researched all the various CSS articles on this which include max-width, background-cover...etc. Yet I can't get my CSS to work.
This is element I'm trying to make full width ( I think):

#site-logo .cs-logo1x

Site: http://beloveden.com

 I cannot figure out why the image won't go full screen. Any help appreciated.
0
Comment
Question by:doug s
  • 2
3 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 40489825
You have to specifically define 100% width on the parent and child elements, in this case the anchor and img.

style.css, line 801:

#site-logo a {
    display: inline-block;
    width: 100%;
}

style.css, line 822:

#site-logo .cs-logo1x {
    display: inline-block !important;
    width: 100%;
}
0
 
LVL 4

Author Comment

by:doug s
ID: 40489902
Thank you so much Tom. How did you know that the anchor was the parent?
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 40489947
You're welcome.

Look at the page in any browser and open the web inspector (like Firebug in Firefox). You will see how the page is being interpreted by the browser regardless of whether the content is being generated dynamically or it's pure HTML markup. I don't know how that image inside the anchor looks on the back end, but for troubleshooting styling problems like this, use a web inspector so you can look directly at the DOM tree of the rendered page. The anchor is clearly the parent of the image from that view.
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
How to hyperlink a document in MS Word w/o full path 1 28
URGENT - Wordpress site missing  theme 9 40
Changing Color of Page Section 4 21
Why a span is lower 2 20
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

786 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