0

Hey,

I have a question on how to make an inline style to this..:

$sqlCommand = "SELECT * FROM pages WHERE subjectid='" . $subjectid . "' AND showing='1' ORDER BY pos ASC";							//*** 
$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); 															
																																	
$PageMenuDisplay = '';																												
while ($row = mysqli_fetch_array($query)) { 																						
$pid = $row["id"];																													
$pagelinklabel = $row["linklabel"];																										
$position = $row['pos'];	                                																		
/* Her sættes $sid=$subjectid ind i linket sammen med pid, sådan at pages ikke forsvinder og kan vises tilhørende det relevante subject */
$PageMenuDisplay .= '<li><a href="index.php?pid=' . $pid . '&amp;sid=' . $subjectid . '">>>> ' . $pagelinklabel . '</a></li>';}//*** 	
																																	//***	
mysqli_free_result($query);

So this gets me 5 links in total.

I gave the links a style like this:

a {border-right: 1px solid #black;}

I just need to make a border-left style (same style..) on the FIRST link that appears after the while have run through the first time.

How can I add a(inline style) left border to that, when the specific tag doesnt appear because they are being pulled from the DB?

The first link have got ID = 1 in the DB, if that is to any use?

Klemme

2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by klemme
0

You don't need any of that, use CSS selectors.

ul li:first-child{
   border-left: ...;
}

BTW - I don't know if it works for IE7. A !DOCTYPE is essential for IE8 though.

Edited by diafol: n/a

0

Thanks!

I added this:

#top_nav ul li a:first-child{border-left:1 px solid #999;}

There is more ul l on the page, so i used the id to target it.

But this is not working, there is no border, I have tjecked IE, google chrome, firefox.

Is there something wrong i the syntax?

0

Still not applying the style with that change :-/

It is possible to do this on links too right?

0
#top_nav ul li:first-child{border-left:1px solid #999;}

You had a space between the number and the 'px'.

Edited by diafol: n/a

0

Aarh you see everything man!

Working and looks the way I wanted it to!

Thanks for helping out!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.