FORUM IS CLOSED. PLEASE USE QUESTIONS / ANSWERS PAGE INSTEAD
Login  |  Forum  |  Search   

Board index » Development » Help requests




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
 
Author Message
 Post subject: [Solved] First and last css style for menu
 Post Posted: Wed May 30, 2012 5:06 pm 
Offline

Joined: Wed May 30, 2012 4:53 pm
Posts: 31
I need to define a CSS style for the first and last item in the menu?
Can you please advise how to customize the php?


Last edited by webgraphic on Mon Jun 04, 2012 6:16 am, edited 1 time in total.

Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Wed May 30, 2012 6:46 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
If you want to do that using PHP, read this article: http://www.impresspages.org/docs2/worki ... on-class2/

I suggest you to try CSS selectors http://www.electrictoolbox.com/css-firs ... selectors/

They might not work on old IE but who cares? It will not be a disaster. It will just look not so nice.


Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Thu May 31, 2012 11:37 am 
Offline

Joined: Wed May 30, 2012 4:53 pm
Posts: 31
maskas wrote:
If you want to do that using PHP, read this article: http://www.impresspages.org/docs2/worki ... on-class2/

I suggest you to try CSS selectors http://www.electrictoolbox.com/css-firs ... selectors/

They might not work on old IE but who cares? It will not be a disaster. It will just look not so nice.


I read this post before I created the query. I don't know but, as programmed using PHP classes.


Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Thu May 31, 2012 7:11 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
If you don't know PHP, use CSS.


Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Thu May 31, 2012 8:07 pm 
Offline

Joined: Wed May 30, 2012 4:53 pm
Posts: 31
maskas wrote:
If you don't know PHP, use CSS.


I need to draw this result that I can style. I don't know how to modify the file common.php

<ul class="level1">
<li class="typeDefault first"><a href="">a</a></li>
<li class="typeDefault"><a href="">b</a></li>
...
<li class="typeDefault last"><a href="">e</a></li>
</ul>

Sorry for my bad English.


Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Thu May 31, 2012 9:18 pm 
Offline
Project Manager

Joined: Wed Nov 25, 2009 9:40 am
Posts: 421
So if you know CSS (you say you can style), just use :first-child and :last-child subselectors. No need of any PHP coding.


Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Thu May 31, 2012 10:42 pm 
Offline

Joined: Wed May 30, 2012 4:53 pm
Posts: 31
Audrius wrote:
So if you know CSS (you say you can style), just use :first-child and :last-child subselectors. No need of any PHP coding.


Thank you for your patience, but I don't understand. The menu is created dynamically with management. Subselectors should I enter somewhere in the administration?


Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Fri Jun 01, 2012 6:26 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
You should change ip_themes/lt_pagan/site.css


Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Sat Jun 02, 2012 9:17 am 
Offline

Joined: Wed May 30, 2012 4:53 pm
Posts: 31
maskas wrote:
You should change ip_themes/lt_pagan/site.css


I still don't understand. CSS styles aren't the problem, but I need the result in HTML
(via php/menu/common.php).


Top 
 Profile  
 
 Post subject: Re: First and last css style for menu
 Post Posted: Sat Jun 02, 2012 2:18 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
The thing you want to achieve, can be achieved using HTML changes or just CSS. CSS is much easier. But if you want to change HTML, you need to know some PHP, because HTML is generated in PHP. Here is manual how to write your own script that generates menu: If you want to do that using PHP, please read this article: http://www.impresspages.org/docs2/worki ... on-class2/


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

Board index » Development » Help requests


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: