Extra Space in H1 tags

More
11 years 3 months ago #1 by jcviau
Replied by jcviau on topic Re: Extra Space in H1 tags
The problem occuur when you are building your h1 tag using PHP.
Simple way to fix it is to make sure the h1,h2,h3 tags are built on a single line without line breaks.

In Joomla, article titles, page titles and module titles are in most case overwritten by your template under /templates/yourtemplates/html/com_content/ or whichever is overwritten.

If you want to fix your problem for you template just go there in template override folder com_content is the component building article layouts and in every article layout your article title must be created somewhere.

Make sure they are construct on a single line if you plan to use Cufon.

Single article layout.
<h2 class="title"><?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?><a href="<?php echo $this->item->readmore_link; ?>"><?php echo $this->escape($this->item->title); ?></a><?php else : ?><?php echo $this->escape($this->item->title); ?><?php endif; ?></h2>

Blog Item Layout
<h2 class="title"><?php if ($params->get('link_titles') && $params->get('access-view')) : ?><a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>"><?php echo $this->escape($this->item->title); ?></a><?php else : ?><?php echo $this->escape($this->item->title); ?><?php endif; ?></h2>

In your template it might be an H1 tag. You will have to do similar modification to other layouts also. If you experiencing same behavior with module titles look in the file modules.php again under HTML folder in your template and make sure H3 tags are construct on a single line.

Good Luck


Jean-Christohe Viau
Joomla Expert at Devel Solution

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #2 by ist_04
Replied by ist_04 on topic Re: Extra Space in H1 tags
A negative margin cheat will suffice. I prefer not to, but may not have a choice.

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #3 by laurelle
Replied by laurelle on topic Re: Extra Space in H1 tags
Hello,

The plugin only sets up the calling the cuffon JS files and css in the head of your template, so I don't think that it is it that is causing the problem. I think it must be something in the actual cufon javascript that is causing the problem. You will need to report the problem to the cufon group and see if they can figure out what is causing this behavior. See wiki.github.com/sorccu/cufon/.

The really strange thing is that the h2 and h3 are fine, so I don't think it has anything to do with the font file. But try one of the default fonts and see if you still get the same behavior.

Try changing doctype to strict.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #4 by ist_04
Replied by ist_04 on topic Re: Extra Space in H1 tags
I tried the Beez and still have the space. When i turn off the plugin, the space is gone. I also triple checked for an extra space in the title and found none.

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #5 by laurelle
Replied by laurelle on topic Re: Extra Space in H1 tags
Hello,

I have tried turning on linkable titles with the Beez template, and have h1, h2 and h3 cufon fonts. My h1, h2 and h3 don't have a space before them.

Try switching to the Beez template and see if you still have the space before your h1 titles. If not, then something in your template is inserting the space. If so, then it seems like the space is in the title.

I don't think your problem is the Cufon plugin or cufon that is adding the space. It is coming from somewhere else.

When you turn off the cufon plugin, is the space gone from before your h1 titles?

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #6 by ist_04
Replied by ist_04 on topic Re: Extra Space in H1 tags
Turning off the linkable title does work, but that will hurt SEO. The CSS changes did nothing, unfort.

I would prefer to have the title linkable, any other suggestions?

Thanx for your time

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #7 by laurelle
Replied by laurelle on topic Re: Extra Space in H1 tags
Hi,

Are you sure that you don't have a space before your titles?

Try removing the following code:
cufon canvas {
position:relative !important;
}
cufon {
font-size:1px !important;
line-height:1px !important;
}
cufon {
text-indent:0 !important;
}

Try not having the title linkable.

See if any of those changes make a difference. I haven't seen this issue before.

Good luck.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #8 by ist_04
Great plugin, makes Cufon a breeze to use. I have had a problem that i cannot solve, and for a new site i must fix it.

When using the Cufon plugin, and extra space is created before the H1 tag.

See an Example

Inspect the Element with Firebug and you will notice...
<cufon class="cufon cufon-canvas" alt=" " style="width: 10px; height: 40px;">
with an empty alt tag. It is only on H1 tags, everything else is fine.

It seems like it is adding a non-existent word spacing. I have tried all the solutions in the forum including moving the plugin to the last position in the System list & the reinstall method. I have not been able to find a script error, though this is not my strong point.

I am currently using Version: 1.3.0 with Joomla Version 1.5.20

Thanx in advance

Please Log in or Create an account to join the conversation.

Joomla! & WordPress Hosts

Liquid Web is our recommended web hosting provider for Joomla! & WordPress websites. This is the host that we use for websites that we build. Liquid Web has an excellent reputation, fast servers and most importantly awesome service! They have technicians that are familiar with Joomla! & WordPress. Their technicians go above and beyond what other hosting providers do, in our opinion.

  

Liquid Web Managed Word Press  

Support Development

Please consider a small donation to support development of the extensions on this site.



Joomla! Login

This is the normal Joomla! login module not the VirtueMart login module. Click the 'Create an account' button to see how you are redirected to the VirtueMart registration form when the KC VM Registration Redirect plugin is enabled.

Joomla! & WordPress Web Design and Development

If you are interested in having a website designed or redesign or need custom Joomla! or WordPress development, please visit Keashly.ca Consulting to view our Portfolio of Joomla! & WordPress website work.

Trademarks and logos remain the property of their respective organizations.
The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries.
Keashly.ca Consulting is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Site Map Back to Top