I'm trying to style my forums. I want to add styles to certain links, to make them look like buttons. Problem is I dont want to write the same styles for different classes. Some links have so many class childs, I don't know how to reference it, eg:

<div class="topic_links">
	<div class="links"><span thmr_curr="1" style="outline: medium none;" id="thmr_14" class="thmr_call">
		<ul class="links inline"><li class="comment_add first">
			<a href="/springburst/comment/reply/62#comment-form" title="Share your thoughts and opinions related to this posting.">Reply to this post</a></li>
			<li class="statistics_counter last"><span>229 reads</span></li>

In the example (firebug output) above, I have created a class div around the html to display links, within the my node-forum.tpl.php file: ie

<div class="topic_links">
	<?php if ($node->links) { ?><div class="links"><?php print custom_links($node->links, 'post'); ?></div><?php } ?>
</div>

how do I reference the anchor tag UNDER my defined "topics_inks" div? and how do I prevent having to write the same 'button' style for different Drupal named link classes?

Comments

juliangb’s picture

In CSS, you can refer to div.topic_links a to style anchor tags that are beneath a div of class topic_links.

You shouldn't have to write the same button style for different named link classes - there will generally be something in common with similar bits of the page so that you can use one rule.

Brian Tastic’s picture

Thanks for your reply Julian. I think I should have been clearer though. yes I want to style the links, but I think I need to style the div that contains the link to make it into a button, and in the example I've given above, that would be:

<li class="comment_add first">

so can you show me an example CSS of how I would refer to that class? so lets say my default button style in the CSS file is:

.button {
 padding: 7px;
 border: 1px solid #ccc;
 background: yellow;
}
Brian Tastic’s picture

Can anybody provide me with some guidance by example please?