Links Module Custom CSS Class

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
5/28/2011 2:15:42 PM
Gravatar
Total Posts 3

Links Module Custom CSS Class

I added a links module to a page and seven links to the list.  These display as follows:

     link A
     link B
     link C
     link D
     link E
     link F
     link G

I want them to display in alphabetical order, three per line, like this:

     link A     link B     link C
     link D     link E     link F
     link G

I assigned a custom CSS class ("storecats") to the links module instance.  I created a separate CSS file containing the following code:

.storecats ul {
    float: left;
    width: 60em;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  
.storecats li {
    float: left;
    width: 20em;
    margin: 0;
    padding: 0;
  }

I added the name of the CSS file to the style.config file in the artisteer-swirly1 skin subdirectory (where I had also placed the custom CSS file).  When I clear the cache and refresh the page, the links list still appears in a single vertical column,  rather than three vertical columns reading left-to-right and then down.  I retried using smaller em values, but the result is always a single vertical column.

I tested the custom CSS file separately in a non-CMS HTML file using a seven item list of links, and it creates the three vertical columns left-to-right and then down the page, as I expected.

I am doing something incorrectly in mojoPortal?

Glenn

 

 

5/29/2011 12:43:39 PM
Gravatar
Total Posts 18439

Re: Links Module Custom CSS Class

Hi Glenn,

My advice is view the source of the rendered page and look at the markup and consider whether there might already be some CSS rules being applied.

In this case the ul has a class "linkitem" (probably not the best choice of class name there), and the li elements alternate with class "linkitem" and "linkaltitem".

So if there are CSS rules somewhere in your CSS for those then you need to override them. You custom CSS should go lower in the file (ie list your custom file at the bottom of style.config to make it come in lower) and the selectors should be a little more specific like:

.storecats ul.linkitem { }

.storecats ul.linkitem li.linkitem, .storecats ul.linkitem li.linkaltitem { }

in order to be sure it overrides any CSS rules above it.

Hope that helps,

Joe

5/29/2011 4:34:47 PM
Gravatar
Total Posts 3

Re: Links Module Custom CSS Class

Joe,

Thanks for your response.

1. The only custom CSS is the file I created containing the ".storecats" reference and the ones associated with the template.  I did modify the selectors to correspond with your suggestions, but the result was the same.

2. I used Firebug to check where the styling for the list was coming from, and it indicated the class "linkitem" for both the ul and li tags.  That class is contained in the stylemojo.css file.

3. My custom CSS file was already at the end of the style.config file in the artisteer-swirly1 subdirectory, but, based on item 2 above, does not appear to be picked up properly.  Is that supposed to happen automatically, or do I have to do something more?  I had followed the instructions online, before submitting my original question.

Do you have any other ideas?

Glenn
 

6/2/2011 6:07:46 AM
Gravatar
Total Posts 18439

Re: Links Module Custom CSS Class

Do you understand the parts about CSS caching from our Skinning Overview article?

CSS is cached both on the server and by the browser, clearing the browser cache does not clear the server cache. You can disable caching by clicking a button to set a cookie under Administration > Advanced Tools > Design Tools, or it can be done from user.config/Web.config

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.