Jump to content
Stef's Coding Community

Drupal and CSS


Recommended Posts

I've been playing around with Drupal for a while now, and just use a basic theme, but not Garland.

Now Drupal when it outputs views as a teaser it automatically makes the heading a link with standard link colours. And although I can alter the font size of these titles I can't seem to find a way to change the link colors or remove the text decoration only by doing it sitewide with a:link, a:active etc. I'm happy to leave the links there, just want them to share the same color as the rest of the text. As it provides a read more link I want this to have a different color as well. Basically want to apply different link colors to different things not the generic red/purple and blue default colors.

 

Really struggling with this so any help appreciated

Link to post
Share on other sites

Can you apply a CSS class to the link, or an element surrounding the link? You could then use that class to specify the link colors. For example:

 

HTML:

 

<div class="teaser">
    <a href="#">Link</a> 
    ... rest of the teaser here...
</div>

and then the CSS:

 

.teaser a:link {}
.teaser a:visited {}
...etc...

Link to post
Share on other sites

Thanks for the reply

 

Sometimes it is good to leave alone for a couple of days and then take another look!!

 

The headings font I could change using css like this

 

.view-content h2 {

font-size: 1.4em;

font-variant: small-caps;

color: #333;

}

 

eventually worked out to change the link colours

 

.view-content h2 a:link,

.view-content h2 a:visited {

color: #333;

text-decoration: none;

}

 

It was the way of adding the a:link etc that I got stuck with.

 

I would obviously be easier as well to be able to learn to change the html classes to be more specific, but for now I will settle for what I have so far.

Link to post
Share on other sites
  • 1 month later...

Might I ask which basic theme you had been playing with? Most tend to prefer one of a handful of "starter" themes... zen seems to be the most popular and the one I use most.

 

And in the event that you have not already done this... Please make sure your modified theming is in a folder at sites/all/themes even if you are just modifying another theme... it is very important that the modified CSS be there, and the calls be directed to there. The reason for this is that when you end up doing an update (which you will - I love Drupal but the number of updates can be high over time) you may inadvertently end up going over existing styles/code. It is a hard less to learn which is why I mention it.

Link to post
Share on other sites

I'm using the Adaptive theme, tried the Zen but somehow didn't get on that well with it.

 

Themes area saved in sites/all/themes.

 

Still much to learn and the thinness of documentation doesn't help. For those that have been using Drupal since the early days it is not so bad, but when you read stuff that talks about a previous version or shows screenshots of earlier versions that look nothing like the modules they are talking about it gets annoying.

 

I stick with it, but haven't had the nerve to switch a site over yet.

Link to post
Share on other sites

I'm using the Adaptive theme, tried the Zen but somehow didn't get on that well with it.

 

Themes area saved in sites/all/themes.

 

Still much to learn and the thinness of documentation doesn't help. For those that have been using Drupal since the early days it is not so bad, but when you read stuff that talks about a previous version or shows screenshots of earlier versions that look nothing like the modules they are talking about it gets annoying.

 

I stick with it, but haven't had the nerve to switch a site over yet.

 

I've gone through versions 4, 5 and 6... with 7 pending.

 

Zen is commented really well and page source can usually net you the class you want. I tried adaptive but it wasn't versatile enough for me...

 

Feel free to PM me if you hit a glitch or just need to bounce something off with Drupal. PM's notify me on my blackberry.

 

Shelley

Link to post
Share on other sites

Hi Shelley,

 

Thanks for that.

I'm getting better at hunting through the forums to find the answers to my problems, which generally are CSS based. I can't get over the number of modules you need just for a fairly simple site. I am up to 18 on one!! And there is nothing fancy added, just basic stuff.

 

As I've only been working with Drupal for less than 12 months I've not touched 7. Will give it a few more months yet until I am more happy with 6.

 

Rosalind

Link to post
Share on other sites

I've played with 7 a bit here and there but I had been holding off until they rolled it out officially for the core + the 15 modules I seem to use most frequently (all having pledged to roll out with 7). I might take another look through this weekend to check those 15 mods but until they all work there is no point in me jumping up to 7. I work on productions sites that often need a fair number of modules.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...