CSS GFX header
Graphical background headers are particularly useful if you plan to create an accessible site without neglecting design aspects. (For more CSS inspiration visit CSS Zengarden.)
What the code does:
1. Create an image and get the path and name of that image
2. Create a h1 tag with the headline text inside
3. Wrap this 2. in a DIV tag
4. Attach the latter created image with the path as background style to the DIV tag
5. Finally override the object in content.default with our object to apply that code actively (see the code in action in this site)
Do not forget: Set the h1 tag to visibility:hidden in your stylesheet, otherwise it won't work properly.
- # create a graphic header image and return path and filename
- cssgfx1 = IMG_RESOURCE
- cssgfx1 {
- file = GIFBUILDER
- file {
- XY = [10.w]+10 ,20
- maxWidth = 500
- backColor = #FFFFFF
- reduceColors =
- 10 = TEXT
- 10 {
- text.current = 1
- text.crop = 50
- fontSize = 13
- # leave font file empty to use default font (Verdana)
- fontFile =
- fontColor = #817D76
- fontColor = #5D7BA1
- offset = 0,17
- }
- }
- }
- #create DIV tag with invisible text <h1> inside and the previously created image as background.
- chead = COA
- chead.wrap=
- chead.1 = TEXT
- chead.1.value=<div style="background-image:url(
- chead.5 = TEXT
- chead.5 < cssgfx1
- chead.7=TEXT
- chead.7.value=); background-repeat:no-repeat; background-position:left top;"><h1>
- chead.10=TEXT
- chead.10.field=header
- chead.20=TEXT
- chead.20.value=</h1></div>
- # override standard gfx header with our chead object
- lib.stdheader.10.1 < chead
