• 0
Sign in to follow this  
Followers 0

Add div to homepage

Question

Posted · Report post

My home page content only needs to contain an image. However, when I tried inserting that image into the page it gets resized and there's too much margin around it (http://akfocus.com/arcnyrr). The image has to be snug against all of the elements surrounding it (navigation menu, sidebar, footer), so I want to see if it's possible to insert a div that appears only on the home page and contains the large image I need. I figured with the div, I can create the "gapless" layout. Thanks, Andrew

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0

Posted · Report post

Hi Andrew, You could just assign the img an ID, or even reference it using the unique class ("home") given to the home page, and drilling down in the CSS. From there you could use negative margins to pull it up and over, or even just decrease the padding of the parent container. If you need help with any of these approaches, let us know.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Kate, Thanks a lot. I've modified themes before, but am having trouble with how exactly Base works. Since I want this to only affect the home page, should I do a conditional tag somewhere using "is_home()" and then insert the Div or do I create a php file for Base... something like "template.[index].php" and place the code in there? Sorry to be annoying.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

If you look at the body tag of any page you will see classes unique to that page. That way you can only affect the homepage right in the CSS, without any php conditionals. Although in this case its not necessary: [code] .wp-image-69 { margin-left:-25px; margin-top:-29px; max-width:none !important; } [/code]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thank you! That worked.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0