Jump to content
php.lv forumi

Linka krāsa nerāda korekti


Basma

Recommended Posts

Sveiki vai ir kāds sastapies ar problēmu šādu, norādu CSS failā krāsu piemēram melnu, bet lapā rāda kā linku zilu ?

CSS fails

.menu_nav

{

color:#333333;

font-size:16px;

text-align:center;

border-bottom:1px solid gray;

padding:5px;

font-weight:bold;

text-decoration:none;

}

menu.php

<?$result2 = mysql_query ("SELECT * FROM categories", $db);

 

if (!$result2)

{

echo "<p><B>Connect Error:</B></p>";

exit(mysql_error ());

}

if (mysql_num_rows($result2)> 0)

{

$myrow2 = mysql_fetch_array ($result2);

 

do

{

printf ("<p class='menu_nav'><a href='view_cat.php?cat=%s'>%s</a><p>",$myrow2["id"], $myrow2["title"]);

 

}

while ($myrow2 = mysql_fetch_array ($result2));

}

 

else

{

echo "<p>Nav ierakstu</p>";

exit ();

}

?>

Link to comment
Share on other sites

norādu CSS failā krāsu piemēram melnu, bet lapā rāda kā linku zilu ?

Tu izmanto <p> elementu kuram noraadiji dotoo klasi, bet kur klase noraadiita pasam <a> ?

tavs kods:

printf ("<p class='menu_nav'><a href='view_cat.php?cat=%s'>%s</a><p>",$myrow2["id"], $myrow2["title"]);

bet buutu jabuut:

printf ("<p class='menu_nav'><a href='view_cat.php?cat=%s' class='menu_nav' >%s</a><p>",$myrow2["id"], $myrow2["title"]);

vai:

printf ("<a href='view_cat.php?cat=%s'  ><p class='menu_nav'>%s<p></a>",$myrow2["id"], $myrow2["title"]);

Edited by Grey_Wolf
Link to comment
Share on other sites

Grey_Wolf: Tavs html's ir briesmīgs :)

Norādīt klasi gan paragrāfam, gan saitei ir lieki, un ielikt bloku iekš inline elementa ir ne tikai lieki, bet arī nepareizi no standartu viedokļa.

 

.menu_nav a 
{
/* stuff */
}

Edited by mad182
Link to comment
Share on other sites

Norādīt klasi gan paragrāfam, gan saitei ir lieki, un ielikt bloku iekš inline elementa ir ne tikai lieki, bet arī nepareizi no standartu viedokļa.

shajaa gadijuma vispar nepieversu tam veriibu ;)

Bet vienkarshi noradiju kur ir problema, kaapec links <a> neizmanto dotoo CSS ..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...