Tips tagged “Css”
- Dynamically Add a Body Id (or class)
-
Posted on June 17, 2009 by Trevor Davis
Typically when I am creating a site, I will use an ID on the body to denote which section I am in. Then, I will also add a class of subpage to all subpages as well.
For example, a subpage may look like this:
<body id="about" class="subpage">And the homepage would look like this:
<body id= - Naming conventions for custom fields and CSS
-
Posted on June 16, 2009 by bluedreamer
When you add custom weblog fields (or any other custom field for that matter) using a matching CSS class/ID name might help you when editing templates or CSS, and reduce the amount of time you have to keep switching back and forth to see what CSS belongs to what HTML (and vice versa.
Let’s say you
- Highlight the current page in your navigation
-
Posted on June 08, 2009 by JonnyUK
Using the segment variables in your template, you can highlight the current page in your navigation.
For primary pages, this is pretty simple. All you need to do is check segment 1 to see if it matches up with a particular navigation item:
<ul>
<li class="{if "{segment_1}" == ""}selected{/if}">< - Using URL Segments for Dynamic Navigation
-
Posted on June 07, 2009 by Jason Hudnutt
ExpressionEngine allows you to dynamically assign CSS navigation based on arguments passed from the URL segment.
This allows you to use CSS to display the active page based on the URL.
<a href="/about/" class="{if segment_1 == "about"}about about-active{if:else}about{/if}"></a>This is just
- Syntax highlighting for CSS and JavaScript template files
-
Posted on June 02, 2009 by Philip Zaengle
Syntax highlighting is great, but when ExpressionEninge saves templates as flat files it uses the .php extension, so by default, unless your coding php or html you lose that nice highlighting.
The fix for this is quite simple, use ExpressionEngine comments!
For CSS (.css) files use:{!--< - Use variables in CSS that’s generated by EE
-
Posted on May 29, 2009 by Philip Zaengle
Sometimes it’s great to use ExpressionEngine to manage CSS, sometimes not. But when I do it’s a great help to use variables in the css document. You can use this for everything from setting colors, fonts, or even debugging.
Often times the same color is used over and over again in a stylesheet. To
