Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Lines Not Lining Up

Posted on 2016-09-24
2
Medium Priority
?
138 Views
Last Modified: 2016-09-25
I have a page where the lines across the top do not line up. When I take out the doctype declaration and <html> tag it lines up. Can someone point me in the right direction?

http://domgarofalo.com/logan/
0
Comment
Question by:dgarofalo
[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 Comments
 
LVL 22

Accepted Solution

by:
Kim Walker earned 2000 total points
ID: 41814273
The issue is that img elements are inline elements just as text content is inline. The default value for the vertical-align property of all img elements is baseline. This means that the img sits above the baseline of the text around it. Whether there is text before or after the image or not, there is descender space below the baseline.

There are two methods of eliminating the descender space below the image. One is to change the vertical-align property to a value of top or bottom. This would cause the image to be aligned to either the top of the text ascenders or the bottom of the text descenders; effectively moving the text baseline up and eliminating the extra space.
img { vertical-align: bottom; }

Open in new window

The second method is to change the image display property to block. Of course, this would only work if the image was placed independently, without any text before or after it.
#header a img { display: block; }

Open in new window

It is interesting that removing the doctype makes a difference. I suppose the default vertical-align property for img elements is different in different versions of HTML.

Allow me to commend you for writing HTML compliant code. The HTML validator returned no errors when evaluating your page.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 41814337
The background image has a fixed position for the lines but your header doesn't have a fixed height to match the position of the lines.  It also looks like the default margins and padding of the header elements is pushing the navigation section down.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 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