Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout Template Wishlist RSS
Color and title ?
Avatar
Mailgifson #1
Member since Dec 2007 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: Color and title ?
Good morning,

I would like to change the color of a title.

I changed the file "design.css", but the color does not change :

div.dokuwiki h1 (font-size: 180%; margin-left: 00px; font-weight: bold; color: blue;)

Someone know it the cause?
An idea to change the color of the text?

Thank you in advance.
This post was edited 2 times, last on 2008-08-09, 10:37 by chi.
chi #2
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
Hi,

try:

  1. div.dokuwiki h1 a {
  2.  color: <color> !important;
  3. }
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
Mailgifson #3
Member since Dec 2007 · 12 posts
Group memberships: Members
Show profile · Link to this post
Thanks, it works with le "a" devant le h1.

I do not understand why there is an explanation?
Avatar
snorri #4
Member since Feb 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
I assume you mean the !important - its a bit of css.

http://www.yellowjug.com/web-design/the-importance-of-impo…
Avatar
g1smd #5
Member since Jan 2009 · 133 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
He asks:

"Why do I need 
h1 a { ... }
  and not just 
h1 { ... }
  here?"
Avatar
ryan.chappelle #6
User title: Chilean DW Fan
Member since May 2008 · 218 posts · Location: Temuco, Chile
Group memberships: Local Moderators, Members, Newsletter Team
Show profile · Link to this post
Because the actual headers text lie inside an <a> element for the anchor. Since any CSS for the anchors (h1 a { or more specifically: h1 > a {) has more specificity than simply pointing to the h* element (h1 {), you need to use either the anchors or !important (not recommended, since it will override the user's styles as well) to stylize them.

If you want to override layout or boxing (for borders, etc), you can style the h1 element alone, but for the actual text and its effects you *need* to target the anchor element.

Check here for more info: [1]

[1]http://www.dokuwiki.org/tips:styling-headers
Chilean DW Fan!
my plugins for DokuWiki
GULIX, my area's LUG
Surviving earthquakes since Feb 2010!
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-09-16, 22:37:21 (UTC +02:00)