Hi, I have a strange requirement for a site, some of the text needs to be completely flush with images above and below as in the attached picture. Any ideo how to do this.
Set the font size, then reduce the line height until the gaps disappear. <html> <head> <style type='text/css'> * { margin: 0; padding: 0; border: 0; } p { font-size: 20px; line-height: 13px; } </style> </head> <body> <div><img src='image1.jpg'></div> <p>HOME/ABOUT/PORTFOLIO</p> <div><img src='image2.jpg'></div> </body> </html> Code (markup): You can also do it with negative margins: p { font-size: 20px; margin-top: -5px; margin-bottom: -5px; } Code (markup):
Thanks, I hadn't thought of negative margins. I also found that using em instead of px for the line height works better.