| | |
| Stránka: 1 z 1
| [ Príspevkov: 16 ] | |
Autor | Správa |
---|
| Napísal dano: 02.12.2013 12:12 | |
|
Ahojte dokoncujem redesign svojej stranky www.arwenthalion.sk a prosim o radu ohladne jednej veci s ktorou neviem pohnut. Konkretne mi ide o to, aby ked kliknem v hlavnom vertikalnom menu na konkretnu polozku (napriklad Kontakt), tak aby po nabehnuti stranky Kontakt ostala dana polozka v menu vysvietena na tu zlatohnedu farbu akou mam vsetky hyperlinky. Zatial sa to sprava tak, ze na zlatohnedu sa to ukazuje len ked cez polozky menu prechadzam mysou. Ako teda spravit to, ze to tak ostane aj po prepnuti? Skusal som to cez class ale ta farba proste zmenit nesla. Snad som sa vyjadril dostatocne zrozumitelne, ak bude treba, upresnim Vdaka za kazdu radu!
|
|
Registrovaný: 17.07.11 Prihlásený: 29.12.20 Príspevky: 1516 Témy: 3 | Napísal BX: 02.12.2013 12:18 | |
|
Najjednoduchšie je dať na každú stranu do menu class na aktívnu položku. Takže napr v diskografia.html budeš mať menu Kód: <ul id="MenuBar1" class="MenuBarVertical"> <li><a href="index.html">Home</a> </li> <li><a href="diskografia.html" class="active">Diskografia</a></li> <li><a href="hudba.html">Hudba</a> </li> <li><a href="download.html">Download</a></li> <li><a href="produkcia.html">Produkcia</a></li> <li><a href="home_studio.html">Home Studio</a></li> <li><a href="kontakt.html">Kontakt</a></li> </ul>
a v css-ku bude Kód: a.active { color: zlatá; }
Naposledy upravil BX dňa 02.12.2013 12:32, celkovo upravené 2
_________________ Na súkromné správy týkajúce sa problémov, ktoré sa riešia vo fóre, neodpovedám! |
|
| Napísal autor témy dano: 02.12.2013 12:20 | |
|
jo ale toto ked som skusil tak to menilo cez tu class vsetko (font, velkost...) len nie tu farbu
|
|
Registrovaný: 17.07.11 Prihlásený: 29.12.20 Príspevky: 1516 Témy: 3 | Napísal BX: 02.12.2013 12:28 | |
|
Skús toto Kód: <li><a href="diskografia.html" style="color:zlatá">Diskografia</a></li> Funguje to? Funguje. Tak to musí ísť aj cez class.
_________________ Na súkromné správy týkajúce sa problémov, ktoré sa riešia vo fóre, neodpovedám! |
|
| Napísal autor témy dano: 02.12.2013 12:32 | |
|
aha jasne. sorkac asi som nieco predtym urobil blbo. vdaka!
|
|
| Napísal autor témy dano: 02.12.2013 13:19 | |
|
pls este v tom css-ku kam konkretne mam dat to a.active? niekde do sekcie sidebar ulnav, alebo ako samostatne niekam? asi toto je ten problem preco mi to nejde cez class
|
|
Registrovaný: 17.07.11 Prihlásený: 29.12.20 Príspevky: 1516 Témy: 3 | Napísal BX: 02.12.2013 13:31 | |
|
samostatne, to je proste samostatná trieda (class) pre prvok a
_________________ Na súkromné správy týkajúce sa problémov, ktoré sa riešia vo fóre, neodpovedám! |
|
| Napísal autor témy dano: 02.12.2013 17:16 | |
|
ja tomu nechapem. pokial to robim cez klasicke HTML tak to funguje. akonahle sa to pokusam urobit cez class, uplne to ignoruje tu farbu. ked do tej class hodim nieco ine, napriklad velkost pisma alebo fnt, krasne to poslucha. ale uplne to ignoruje tu farbu. cim to moze byt? je mozne ze niekde uz mam nieco zadefinovane a to je nadradene tej farbe v tejto class? pre istotu sem davam cele css stranky: Kód: @charset "utf-8"; body { background-color: #0B0B0B; margin: 0; padding: 0; color: #E2E2E2; font-family: "Courier New", Courier, monospace; font-size: 12px; line-height: normal; font-style: normal; font-weight: normal; font-variant: normal; } /* ~~ Element/tag selectors ~~ */ ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */ padding: 0; margin: 0; } h1, h2, h3, h4, h5, h6, p { margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing block. The remaining bottom margin will hold it away from any elements that follow. */ padding-right: 1px; padding-left: 1px; /* adding the padding to the sides of the elements within the blocks, instead of the block elements themselves, gets rid of any box model math. A nested block with side padding can also be used as an alternate method. */ padding-top: 10px; padding-bottom: 0px; } .content section p { line-height: 20px; clip: rect(auto,auto,auto,auto); }
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */ border: none; } /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */ a:link { color: #CC9900; text-decoration: none; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */ } a:visited { color: #CC9900; text-decoration: underline; } a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */ text-decoration: underline; } /* ~~ This fixed width container surrounds all other blocks ~~ */ .container { width: 800px; background-color: #0B0B0B; /* the auto value on the sides, coupled with the width, centers the layout */ margin-top: 0; margin-right: auto; margin-bottom: 0; float: left; margin-left: 40px; } /* ~~ The header is not given a width. It will extend the full width of your layout. ~~ */ header { background-color: #0B0B0B; background-image: url(../images/index/at_logo.gif); background-repeat: no-repeat; background-position: left 25px; height: 80px; } /* ~~ These are the columns for the layout. ~~
1) Padding is only placed on the top and/or bottom of the block elements. The elements within these blocks have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the block itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the block element and place a second block element within it with no width and the padding necessary for your design.
2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a block set to float right). Many times, padding can be used instead. For blocks where this rule must be broken, you should add a "display:inline" declaration to the block element's rule to tame a bug where some versions of Internet Explorer double the margin.
3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar blocks could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.
4) If you prefer your nav on the left instead of the right, simply float these columns the opposite direction (all left instead of all right) and they'll render in reverse order. There's no need to move the blocks around in the HTML source.
*/ .sidebar1 { float: left; width: 185px; padding-bottom: 10px; background-color: #0B0B0B; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #B4B4B4; line-height: 20px; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; } .content { width: 590px; float: right; padding-top: 10px; padding-right: 0px; padding-bottom: 10px; font-family: "Courier New", Courier, monospace; color: #E2E2E2; border-top-width: thin; border-top-style: solid; border-top-color: #B4B4B4; border-bottom-width: thin; border-bottom-style: solid; border-bottom-color: #B4B4B4; padding-left: 0px; clip: rect(auto,auto,auto,auto); line-height: 20px; } .content section h2 { font-size: 15px; font-family: "Courier New", Courier, monospace; font-weight: bolder; }
.content h1 { font-family: "Courier New", Courier, monospace; font-size: 18px; line-height: normal; text-align: left; padding: 0px; }
/* ~~ This grouped selector gives the lists in the .content area space ~~ */ .content ul, .content ol { padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */ line-height: 20px; } .content section table { width: 590px; margin-top: 25px; margin-bottom: 10px; }
/* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */ ul.nav { list-style: none; /* this creates the top border for the links - all others are placed using a bottom border on the LI */ margin-bottom: 15px; /* this creates the space between the navigation on the content below */ border-top-width: thin; border-top-style: solid; border-top-color: #B4B4B4; border-bottom-width: thin; border-bottom-style: solid; border-bottom-color: #B4B4B4; } ul.nav li { border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; } ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */ display: block; /*this width makes the entire button clickable for IE6. If you don't need to support IE6, it can be removed. Calculate the proper width by subtracting the padding on this link from the width of your sidebar container. */ text-decoration: none; background-color: #0B0B0B; color: #B4B4B4; padding-right: 5px; padding-bottom: 5px; padding-top: 5px; padding-left: 1px; } ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */ color: #C90; }
/* ~~ The footer ~~ */ footer { background-color: #0B0B0B; position: relative;/* this gives IE6 hasLayout to properly clear */ clear: both; /* this clear property forces the .container to understand where the columns end and contain them */ font-family: "Courier New", Courier, monospace; font-size: 12px; color: #B4B4B4; text-indent: 210px; padding-top: 10px; padding-right: 0; padding-bottom: 10px; padding-left: 0; }
/*HTML 5 support - Sets new HTML 5 tags to display:block so browsers know how to render the tags properly. */ header, section, footer, aside, article, figure { display: block; } nav p { font-size: 10px; color: #B4B4B4; text-align: right; font-family: Arial, Helvetica, sans-serif; background-color: #0B0B0B; padding-right: 1px; padding-bottom: 5px; margin: 0px; } nav p a:link, nav p a:visited { text-decoration: none; color: #B4B4B4; } nav p a:hover, nav p a:active { color: #C90; } .sidebar1 aside { font-family: "Courier New", Courier, monospace; font-size: 14px; text-align: center; clip: rect(auto,auto,auto,auto); } .flt_lft { float: left; margin-right: 10px; margin-top: 6px; margin-bottom: 0px; margin-left: 1px; } .flt_rgt { float: right; margin-left: 10px; margin-top: 6px; margin-right: 1px; margin-bottom: 0px; } .content section fieldset { border: thin solid #B4B4B4; margin-top: 24px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
} a.active { color: #C90; }
|
|
Registrovaný: 17.07.11 Prihlásený: 29.12.20 Príspevky: 1516 Témy: 3 | Napísal BX: 02.12.2013 17:28 | |
|
CSS si vieme pozrieť v zdrojáku stránky Problémy ti tam robí súbor spry_assets/spry_menu_bar_vertical.css. Odstráň riadok Kód: <link href="spry_assets/spry_menu_bar_vertical.css" rel="stylesheet" type="text/css"> a pôjde to. Bohužiaľ, nepodarilo sa mi zistiť, ako to opraviť, ale najlepšie riešenie bude aj tak - Vyhoď ten blbý spry menubar a naštýluj si to sám. Veď sú to len odkazy a farby...
_________________ Na súkromné správy týkajúce sa problémov, ktoré sa riešia vo fóre, neodpovedám! |
|
| Napísal autor témy dano: 02.12.2013 18:24 | |
|
toto praveze skusam vo verzii bez toho spry menu bar, uplne basic a proste to nejde. teraz je na webe verzia bez spry menu bar, uplne zakladna. pri kazdej stranke som hodil do menu ten active class a vytvoril v css class s tou farbou. a nic... ale ked napriklad v tej class zmenim velkost fontu tak nie je problem. ani typ pisma. proste jedine na co to nereaguje je len a len ta farba.. ak to nepojde tak sa na to vykaslem a dam to cez html ako si dal vyssie <li><a href="diskografia.html" style="color:zlatá">Diskografia</a></li> ved to je vlastne jedno ze to nebude ako class v css ale len html kod nie?
|
|
Registrovaný: 17.07.11 Prihlásený: 29.12.20 Príspevky: 1516 Témy: 3 | Napísal BX: 02.12.2013 18:28 | |
|
dano píše: proste jedine na co to nereaguje je len a len ta farba.. No hej, lebo je definovaná niekde vyššie a proste ju neprebiješ. Ak by si to upravil na toto Kód: a.active { color: #C90 !important; }
tak by to šlo. To important si proste vynúti, že toto sa má použiť a hotovo. Vo všeobecnosti ale important radšej nepoužívaj a skús sa radšej prebiť cez všetky vyššie vrstvy. Takže tu musíš ísť až na ul.nav, čiže napíš Kód: ul.nav a.active { color: #C90; }
a už konečne ide. A je to jedno, dokým nerobíš väčší web. To časom zistíš. Radím ti ale, zvykni si radšej na css. Všade.
_________________ Na súkromné správy týkajúce sa problémov, ktoré sa riešia vo fóre, neodpovedám! |
|
| Napísal autor témy dano: 02.12.2013 18:31 | |
|
ok dakujem este raz!
|
|
| Napísal autor témy dano: 02.12.2013 18:46 | |
|
to ul nav active zabralo a slape to ako hodinky
|
|
| Napísal autor témy dano: 08.12.2013 11:24 | |
|
Takze nakoniec predsa len este jedna otazocka Ako mam spravit to, aby v tom vertikalnom menu bola ako hyperlinkove pole aktivna vzdy len ta oblast okolo samotneho textu? Lebo teraz je v kazdej polozke menu aktivny tak samotny text, ako aj ta prazdna cast za nim, az po ukoncenie oblasti menu. Cize ked prechadzate mysou po vertikalnom menu, nemusite ist ani na text, staci ist aj na tui prazdnu cast za nim a text sa vysvecuje a je to aktivne ako hyperlink. Skusim dat priklad lebo asi pisem ako madar Polozka "home" v menu - ked idete mysou na samotny text, polozka sa vysvieti. To iste sa ale deje aj ked idete mysou do toho prazdneho priestoru za textom "home" a tiez sa to vysvecuje. Ako teda spravit to, ze ako hyperlink sa bude spravat len ten ext? Asi to nebude uplne jednoduche, kedze kazda polozka menu je rozne dlha a teda bude treba nejako nastavit rozmer toho aktivneho priestoru pre kazdu polozku menu zvlast. Diky
|
|
Registrovaný: 21.02.06 Prihlásený: 08.12.14 Príspevky: 5404 Témy: 30 Bydlisko: Bratislava | Napísal shaggy: 08.12.2013 12:14 | |
|
Skús dať odkaz na živú ukážku a nebudeš musieť písať ako maďar.
_________________ Neradím a nekomunikujem cez SS, ak niečo potrebujete, máte iné možnosti: Ak vám zmizla téma, alebo sa vám niečo nepáči. Ak potrebujete nahlásiť príspevok/človeka, reportujte ho. Ak máte s niečim problém, riešte to v danej téme. |
|
| Stránka: 1 z 1
| [ Príspevkov: 16 ] | |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|