Solved

Full Width Image with CSS

Posted on 2014-12-09
3
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

733 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