Solved

Full Width Image with CSS

Posted on 2014-12-09
3
210 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
Comment Utility
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
Comment Utility
Thank you so much Tom. How did you know that the anchor was the parent?
0
 
LVL 38

Expert Comment

by:Tom Beck
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to dynamically set the form action using jQuery.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now