Jump to content

Recommended Posts

Posted

I have the following code that I cannot get to react to my css:

 

 

<div>random text</div>

 

<div class="line_specs"><a style="cursor: pointer;" title="tool tip" onclick="window.open('http://www.mydomain/specs.com', 'StatusBar', 'toolbar=no,resizable=no,scrollbars=yes,width=750,height=500,left=100,top=100');">

<em><strong>Line Specifications</strong></em></a></div>

 

 

No matter what I do I cannot reduce the amount of space above the word "Line Specifications".It's like there is an extra space above it.

 

I tried using css and effecting the "a" tag to reduce the space like so:

 

.line_specs a{

margin: 0px 0px 0px 0px;

 

}

 

I tried adding a p tag to the word "line specifications" but that didn't work either.

.line_specs p{

margin: 0px 0px 0px 0px;

 

}

 

If I take the code and remove all the onclick info etc and just test my css with say a simple p tag the css margin works fine.

 

 

Any help is appreciated.

 

Thanks

A.

Posted

When I test the exact code you have provided in a new HTML file, I'm not getting any space between the two elements, so there must be something else going on. Could you post a link to the site (ideally) or a zip of the files (html, css, images) so we can see it in action?

 

Have you checked using standard CSS debugging tools -- Firebug for Firefox, the Chrome Console in Chrome, or IE's developer tools? Any of those should be able to tell you what is causing the spacing.

Posted

When I look in firebug (see screenshot) I see a line break within the <a> just before the <em></em>. I'm not sure why that is there -- perhaps being inserted by the CMS you are using or something? -- but that's what is causing the space.

 

screenshot.gif

Posted

Ben, thank you.

 

The problem was indeed the CMS (wordpress).

 

In the html view there was a return in the code but I guess for some reason, even though I though spaces and returns do not effect the code in html, it did in this instance.

 

A.

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
×
×
  • Create New...