Hi, I'm trying to get a drupal site using a php page to stop showing the giant title (a h2 tag with a class of "title") link at the beginning of content. I've read through some suggestions in CSS but none have worked. I even tried some php code but still, content shows the title at the top of the page in a nice big font. It wouldn't be as bad if I could tweak it so that the title was smaller, but since it's not listening to the CSS or PHP code I've used, it's simply frustrating. Any ideas on how to fix this? Thanks.

Here is what the code looks like in my page:


   <div class="content">

 	 <?php print $content; ?>
 
 </div>

And this is what is generated:

 <div class="content">

 	 <!-- begin content -->  <div class="node">
        <h2 class="title"><a href="/community//index.php?q=node/18">Title of Content</a></h2>    <span class="submitted"></span>
    <span class="taxonomy"></span>

Comments

nevets’s picture

As I have modified the title css many times I known it can work and if the only problem is it is too large the is the approach I would suggest. If you can post a link to an example page I can help you with the css to shrink the title size.

tonyphp’s picture

It's being developed on a test server so I can't post a link.

What CSS style did you use to shrink or remove the title? I tried the following and a few variations but it did not work.

#title h2 { display: none; }
nevets’s picture

Try h2.title, h2.title a as the css selector. title is a class (not an id a # would suggest) of the h2 tag. If changing the font size you need the second part (h2.title a) since the title is a link. When adding to style.css make sure it is after any more general css rules for .title (at the end of the file should work).

tonyphp’s picture

Thanks, I tried that but it still isn't reacting. I don't know if this is because the h2 title tag is being generated by Drupal or not... I'm also testing this out on IE so perhaps that may be effecting things, but generally by now (after having tested a number of CSS styles) I should have seen a change but I have not.

nevets’s picture

Just to make sure, are you doing a page refresh/reload after saving the css changes?

tonyphp’s picture

Yes I am.

#title h2 { display: none; }

#header {
display:none;
}

h2.title, h2.title, a.title, .title a {
  color: #ffffff;
  display: none;
}

a.H2 { font-weight: 70 }

div.node h2.title {
display:none; }

None of those are causing the title tage generated by the $content to be altered.

nevets’s picture

I just placed this at the end of my style.css and it works for me

#main h2.title {
font-size: 0.7em;
}
#main h2.title a {
  color: red;
  text-decoration: none;
}

Does this do the trick?

tonyphp’s picture

Unfortunatly, no. I put a sample of what I'm talking about on my live server for a short time: http://www.nachc.com/community//
The title at the top of the content section is what I'm trying to get rid of.

Thanks

acp’s picture

Hello,

actually your problem is that your h2 title is also a link, that's why h2.title doesn't work. Try this :

h2.title a {
# Your CSS code here
}

Btw, if you want more control on what is printed and not, changing your template's code might be a good idea.

edit : that works on a local copy of the page you gave above with firefox.

tonyphp’s picture

Thanks! The other thing I had to do is have it in the page itself, not the css.