Test Your Website

Visitors



43.3%Netherlands Netherlands
5.9%Germany Germany
5.9%United States United States
3.9%Belgium Belgium
3.9%India India
3.8%Spain Spain
3.3%Italy Italy
3.2%Poland Poland
2.6%France France
2.5%United Kingdom United Kingdom
2.3%Greece Greece
1.6%Russian Federation Russian Federation
1.2%Japan Japan
1.1%Australia Australia
1.1%Canada Canada

Today: 136
Yesterday: 332
This Week: 1922
Last Week: 2391
This Month: 6079
Last Month: 9098
Total: 25247


Featured / Category Blog

We already have styled a lot of elements that are present on the featured or category blog page.

 

Print screen of the featured blog page without additional CSS.

 

Voorpagina Blog

 

Structure of the featured blog page without the elements we already styled

 

div.blog-featured 
	h1

	div.items-leading
		div.leading-0
			h2 a
	
	div.items-row.cols-2.row-0
		div.item.column-1
			h2 a
			p
			
		div.item.column-2
			h2 a
			p

	div.items-row.cols-2.row-1
		div.item.column-1
			h2 a
			p
			
		div.item.column-2
			h2 a
			p

 

CSS

We first float the articles 2 and 3 next to each other and we want to have the icons on the same line as the title of the artcle.

 

/* ---------------------
   Intro / subitems
---------------------- */
div.items-row {
	clear: left;
	float: left; /* IE 6/7 Fix */
	width: 100%; /* IE 6/7 Fix */
}

div.cols-2 {
	overflow: hidden;
}

div.item h2 {
	display: block;
	float: left;
	width: 70%;
	margin: 0 0 5px 0;
}

div.column-1 {
	width: 265px;
	float: left;
	padding: 0 9px 9000px 0;
	margin: 20px 0 -9015px 0;
	height: 100%;
	border-right: 1px #999 solid;
}

div.column-2 {
	width: 265px;
	float: left;
	padding: 0 0 9000px 10px;
	margin: 20px 0 -9015px 0;
	height: 100%;
}

 

Print screen after applying CSS

 

Voorpagina blog

 

Note

The difficult part was to style a vertical border between the articles 2 nd 3. De div's of the articles have a different length, because of the difference in length of the content. To resolve this, give both div's a large padding-bottom (9000 pixels) and a negative margin-bottom of the same value (-9000 pixels) + the heigth of the row separator (15 pixels). Total margin-bottom will be -9015 pixels. Now both div's have an equal length.

 

Additional CSS for the headings

 

/* Leading article heading and title */
div.blog-featured h1 {
	margin: 0 0 15px 0;
}

div.items-leading div.leading-0 h2,
div.items-leading div.leading-1 h2 {
	display: block;
	float: left;
	width: 80%;
}

div.items-leading div.leading-0 h2 a,
div.items-leading div.leading-1 h2 a {
	text-decoration: none;
}

div.items-leading div.leading-0 h2 a:hover,
div.items-leading div.leading-1 h2 a:hover {
	text-decoration: none;
}

 

Print screen after applying CSS

 

Voorpagina Blog

 

Voorpagina Blog

 

Category blog

The category blog page has a view extra elements that are not present on the featured blog page. These are a subheading and a category description.

 

Structure with classes and id's

 

div.blog
	h1
	h2 span.subheading-category
	div.category-desc p
		div.clr

 

Print screen of the category page without additional CSS

 

Categorie Blog

 

CSS

 

/* Blog category */
div.blog h1 {
	margin: 0 0 15px 0;
}

/* Subheading & description blog category */
span.subheading-category {
	clear: both;
	display: block;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	line-height: 11px;
	color: #666;
	margin: 10px 0 0 0;
}

/* Category description */ 
div.category-desc p {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-size: 10px;
   line-height: 11px;
   color: #666;
   padding: 3px 0 10px 0;
}

div.category-desc div.clr {
	clear: both;
}


 

Print screen after applying CSS

 

Categorie Blog

Comments (4)
  • Rob van Oudheusden  - Re: ul.actions same line as h2
    Hello Luke,

    Thank you for your comment.
    The "item-page" is a class that belongs to a single article and not to a blog page. If you go to the single article styles on the next page, you see that the class: "item-page" is floated just like the class: "item". In your CSS document you put them together ofcourse, just like you suggested.

  • Luke  - ul.actions same line as h2
    Hey Rob!

    I don't know, if this maybe is another change from 1.6 to 1.7, but I found the following lines not working for the solution you want to achieve:

    div.item h2 {
    display: block;
    float: left;
    width: 70%;
    margin: 0 0 5px 0;
    }

    The problem: the class of the leading article is named "item-page" in J!1.7. And because of this, your code doesn't float the title of the leading paragraph. The floating for the coloumns below that article works just fine.

    To solve the issue with the leading article just right

    div.item h2, div.item-page h2{ .... }

    The rest of your css works perfectly - as always :)
  • Rob van Oudheusden  - HELP
    All the CSS here are tested. Just send me the address of your website and I will look into it.
    You can send it to my email info@joomla-css.nl if you want
  • Robert-Jeffrey  - HELP!
    Tried youre tutorials, some arnt working, like this one here. The Print icon isnt one the same level as the a:houver effect and also there is no split up
Post a commment or ask a question!
Your Contact Details:
Comment:
Security
Please input the anti-spam code that you can read in the image.