Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Dlaczego identyfikator nie działa
Forum PHP.pl > Forum > Po stronie przeglądarki
mylovelyengland
Chodzi mi o znacznik li.
Jak dam:
  1. li {
  2. display: inline;
  3. margin: 0px 3px;}



To wszystko działa jak należy ale ja chcę opisać pozycję każdego znacznika li względem poprzedniego ;/

  1. <!DOCTYPE html>
  2. <title>Pude􀃯ka elementów</title>
  3. <style type="text/css">
  4. body {
  5. font-size: 80%;
  6. font-family: Courier New, Courier, monospace;
  7. letter-spacing: 0.15em;
  8. background-color: #efefef;}
  9. #page {
  10. max-width: 940px;
  11. min-width: 720px;
  12. margin: 10px auto 10px auto;
  13. padding: 20px;
  14. border: 4px double #000;
  15. background-color: #ffffff;}
  16. #logo {
  17. width: 150px;
  18. margin: 30px auto 10px auto;}
  19. ul {
  20. width: 580px;
  21. padding: 10px;
  22. margin: 0px auto 120px auto;
  23. border-top: 2px solid #000;
  24. border-bottom: 1px solid #000;
  25. text-align: center;}
  26. li#one {
  27. display: inline;
  28. margin-left: 5px;}
  29. li#two {
  30. display: inline;
  31. margin-left: 10px;}
  32. li#three {
  33. display: inline;
  34. margin-left: 15px;}
  35. p#one {
  36. text-align: center;
  37. width: 600px;
  38. margin: 0px auto 20px auto;
  39. font-weight: normal;}
  40. li#four {
  41. display: inline;
  42. margin-left: 20px;}
  43. li#five{
  44. display: inline;
  45. margin-left: 20px;}
  46. p#two {
  47. text-align: center;
  48. width: 600px;
  49. margin: 40px auto 20px auto;
  50. font-weight: normal;}
  51. a:hover, a.on {
  52. color: #cc3333;
  53. background-color: #ffffff;}
  54. </head>
  55. <div id="page">
  56. <div id="logo">
  57. <img src="images/logo.gif” alt=”Analogowi specjali􀄂ci" />
  58. </div>
  59. <ul id="navigation">
  60. <li id="one"><a href="www.allegro.pl" class="on">Początek</a></li>
  61. <li id="two"><a href="www.wp.pl">Sprzedż</a></li>
  62. <li id="three"><a href="www.google.pl">Naprawy</a></li>
  63. <li id="four"><a href="www.interia.pl">O nas</a></li>
  64. <li id="five"><a href="www.hack.pl">Kontakt</a></li>
  65. </ul>
  66. <p id="one">
  67. <img src="images/keys.jpg" alt="Fender Rhodes, Hohner Clavinet
  68. oraz Wurlitzer EP200" />
  69. </p>
  70. <p id="two">
  71. Specjalizujemy się w sprzedaży oraz naprawach klasycznych instrumentów
  72. klawiszowych, a w szczególności: Fender Rhodes, Wurlitzer EP200 oraz
  73. Hohner Clavinet.
  74. </p>
  75. </div>
  76. </body>
  77. </html>


A wartości margin się dodaje między 2 elementami co nie?
Comandeer
No nie do końca (obadaj hasło "margin collapsing"). Poza tym AFAIR dla elementów liniowych ciężko margines ustawić.
mylovelyengland
a dlaczego ten kod nie działa tak jak należy tzn nie ma obramowania tabeli kolorów tła i nie ustawia tekstu tam gdzie trzeba i tak jak trzeba?
  1. <!DOCTYPE html>
  2. <title>Pudełka elementów</title>
  3. <style type=&#8221;text/css&#8221;>
  4. body {
  5. font-family: Arial, Verdana, sans-serif;
  6. color: #111111;}
  7. table {
  8. width: 600px;}
  9. th, td {
  10. padding: 7px 10px 10px 10px;}
  11. th {
  12. text-transform: uppercase;
  13. letter-spacing: 0.1em;
  14. font-size: 90%;
  15. border-bottom: 2px solid #111111;
  16. border-top: 1px solid #999;
  17. text-align: left;}
  18. tr.even {
  19. background-color: #efefef;}
  20. tr:hover {
  21. background-color: #c3e6e5;}
  22. .money {
  23. text-align: right;}
  24. </head>
  25. <h1>Aukcja literatury obcej</h1>
  26. <tr>
  27. <th>Autor</th>
  28. <th>Tytuł</th>
  29. <th class="money">Cena minimalna</th>
  30. <th class="money">Bieżąca oferta</th>
  31. </tr>
  32. <tr>
  33. <td>E.E. Cummings</td>
  34. <td>Tulips & Chimneys</td>
  35. <td class="money">6520,00 zł</td>
  36. <td class="money">7612,95 zł</td>
  37. </tr>
  38. <tr class="even">
  39. <td>Charles d’Orlans</td>
  40. <td>Pomes</td>
  41. <td class="money"></td>
  42. <td class="money">11 754,55 zł</td>
  43. </tr>
  44. <tr>
  45. <td>T.S. Eliot</td>
  46. <td>Poems 1909 - 1925</td>
  47. <td class="money">4075,00 zł</td>
  48. <td class="money">27 706,00 zł</td>
  49. </tr>
  50. <tr class="even">
  51. <td>Sylvia Plath</td>
  52. <td>The Colossus</td>
  53. <td class="money"></td>
  54. <td class="money">3361,00 zł</td>
  55. </tr>
  56. </body>
  57. </html>
vokiel
https://jsfiddle.net/xLnshLbh/1/

Takie coś, czy miałeś na myśli coś innego?
mylovelyengland
tak to to. Jeszcze jedno mam pytanie jest kod taki:
  1. <!DOCTYPE html>
  2. <head>
  3. <title>Styling Submit Buttons</title>
  4. <style type="text/css">
  5. input {
  6. font-size: 120%;
  7. color: #5a5854;
  8. background-color: #f2f2f2;
  9. border: 1px solid #bdbdbd;
  10. border-radius: 5px;
  11. padding: 5px 10px 5px 30px;
  12. background-repeat: no-repeat;
  13. background-position: 8px 9px;
  14. display: block;
  15. margin-bottom: 10px;}
  16. input#submit {
  17. color: #444444;
  18. text-shadow: 0px 1px 1px #ffffff;
  19. border-bottom: 2px solid #b2b2b2;
  20. background-color: #b9e4e3;
  21. background: -webkit-gradient(linear, left top, left bottom, from(#beeae9), to(#a8cfce));
  22. background: -moz-linear-gradient(top, #beeae9, #a8cfce);
  23. background: -o-linear-gradient(top, #beeae9, #a8cfce);
  24. background: -ms-linear-gradient(top, #beeae9, #a8cfce);}
  25. input#submit:hover {
  26. color: #333333;
  27. border: 1px solid #a4a4a4;
  28. border-top: 2px solid #b2b2b2;
  29. background-color: #a0dbc4;
  30. background: -webkit-gradient(linear, left top, left bottom, from(#a8cfce), to(#beeae9));
  31. background: -moz-linear-gradient(top, #a8cfce, #beeae9);
  32. background: -o-linear-gradient(top, #a8cfce, #beeae9);
  33. background: -ms-linear-gradient(top, #a8cfce, #beeae9);}
  34. input:focus, input:hover {
  35. background-color: #ffffff;
  36. border: 1px solid #b1e1e4;}
  37. input#email {
  38. background-image: url("images/email.png");}
  39. input#twitter {
  40. background-image: url("images/twitter.png");}
  41. input#web {
  42. background-image: url("images/web.png");}
  43. </style>
  44. </head>
  45.  
  46. <body>
  47.  
  48. <form>
  49. <input type="text" id="email" />
  50. <input type="text" id="twitter" />
  51. <input type="text" id="web" />
  52. <input type="submit" value="Rejestruj" id="submit" />
  53. </form>
  54.  
  55. </body>
  56. </html>



Wg mnie te 2 elementy powinny się odnosić do przycisku a odnosi się tylko ten element z identyfikatore submit. dlaczego w tym momencie się nie pomieszało?
input:focus, input:hover
input#submit:hover
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.