[HTML/CSS] Łączenie DIV'ow i class - Wersja do druku
+- Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów (https://www.webmastertalk.pl)
+-- Dział: Technologie internetowe - tworzenie stron WWW (https://www.webmastertalk.pl/forum-technologie-internetowe-tworzenie-stron-www)
+--- Dział: Początkujący webmaster (https://www.webmastertalk.pl/forum-poczatkujacy-webmaster)
+--- Wątek: [HTML/CSS] Łączenie DIV'ow i class (/thread-html-css-%C5%82aczenie-div-ow-i-class)
|
[HTML/CSS] Łączenie DIV'ow i class - LordHammer - 20-03-2011
Witam.
Postaram się krótko opisać z czym nie mogę sobie poradzić.
Posiadam kod w którym dla menu wszystko oznaczone jest w pliku css jako <ul class="art-menu"> podałem tu wszystko co powiązane jest wzajemnie z plikiem html i css od nośnie menu.
Chcę pozbyć się <ul class oraz <span class i użyć samego <div class.
Pokażę dokładnie o co mi chodzi mam coś takiego:
W kodzie html:
Cytat:...
<div class="art-nav-center">
<ul class="art-menu">
<li><a href="./home.html" class="active">
<span class="l"> </span>
<span class="r"> </span>
<span class="t">Home</span>
</a></li>
<li><a href="./ministries.html">
<span class="l"> </span>
<span class="r"> </span>
<span class="t">Ministries</span>
</a></li>
<li><a href="./articles.html">
<span class="l"> </span>
<span class="r"> </span>
<span class="t">Events</span>
</a></li>
<li><a href="./photos.html">
<span class="l"> </span>
<span class="r"> </span>
<span class="t">Photos</span>
</a></li>
<li><a href="./contacts.html">
<span class="l"> </span>
<span class="r"> </span>
<span class="t">Contacts</span>
</a></li>
</ul>
</div>
...
Oraz w CSS:
Cytat:...
.art-menu a, .art-menu a:link, .art-menu a:visited, .art-menu a:hover
{
outline: none;
}
.art-menu, .art-menu ul
{
margin: 0;
padding: 0;
border: 0;
list-style-type: none;
display: block;
}
.art-menu li
{
margin: 0;
padding: 0;
border: 0;
display: block;
float: left;
position: relative;
z-index: 5;
background: none;
}
.art-menu li:hover
{
z-index: 10000;
white-space: normal;
}
.art-menu li li
{
float: none;
}
.art-menu ul
{
visibility: hidden;
position: absolute;
z-index: 10;
left: 0;
top: 0;
background: none;
min-height: 0;
background-image: url('images/spacer.gif');
padding: 10px 30px 30px 30px;
margin: -10px 0 0 -30px;
}
.art-menu li:hover>ul
{
visibility: visible;
top: 100%;
}
.art-menu li li:hover>ul
{
top: 0;
left: 100%;
}
.art-menu:after, .art-menu ul:after
{
content: ".";
height: 0;
display: block;
visibility: hidden;
overflow: hidden;
clear: both;
}
.art-menu{
min-height: 0;
padding: 9px 10px 9px 10px;
}
.art-menu ul ul
{
padding: 30px 30px 30px 10px;
margin: -30px 0 0 -10px;
}
ul.art-menu
{
position: relative;
float: left;
left: 50%;
}
.firefox2 ul.art-menu
{
float: none;
}
....
.art-menu a
{
position: relative;
display: block;
overflow: hidden;
height: 23px;
cursor: pointer;
text-align: left;
text-decoration: none;
}
.art-menu ul li
{
margin:0;
clear: both;
}
.art-menu a .r, .art-menu a .l
{
position: absolute;
display: block;
top: 0;
z-index: -1;
height: 79px;
background-image: url('images/menuitem.png');
}
.art-menu a .l
{
left: 0;
right: 8px;
}
.art-menu a .r
{
width: 416px;
right: 0;
clip: rect(auto, auto, auto, 408px);
}
.art-menu a .t, .art-menu ul a, .art-menu a:link, .art-menu a:visited, .art-menu a:hover
{
text-align: left;
text-decoration: none;
}
.art-menu a .t
{
color: #CBD2D2;
padding: 0 5px;
margin: 0 8px;
line-height: 23px;
text-align: center;
}
.art-menu a:hover .l, .art-menu a:hover .r
{
top: -28px;
}
.art-menu li:hover>a .l, .art-menu li:hover>a .r
{
top: -28px;
}
.art-menu li:hover a .l, .art-menu li:hover a .r
{
top: -28px;
}
.art-menu a:hover .t
{
color: #052333;
}
.art-menu li:hover a .t
{
color: #052333;
}
.art-menu li:hover>a .t
{
color: #052333;
}
.art-menu a.active .l, .art-menu a.active .r
{
top: -56px;
}
.art-menu a.active .t
{
color: #DEE2E3;
}
/* end MenuItem */
/* begin MenuSeparator */
.art-menu .art-menu-li-separator
{
display: block;
width: 9px;
height:23px;
}
.art-nav .art-menu-separator
{
display: block;
margin:0 auto;
width: 1px;
height: 23px;
background-image: url('images/menuseparator.png');
}
/* end MenuSeparator */
/* begin MenuSubItem */
.art-menu ul a
{
display: block;
white-space: nowrap;
height: 20px;
width: 240px;
overflow: hidden;
background-image: url('images/subitem.png');
background-position: left top;
background-repeat: repeat-x;
border-width: 0;
border-style: solid;
text-align: left;
text-indent: 12px;
text-decoration: none;
line-height: 20px;
color: #1A1E1E;
font-size: 11px;
margin:0;
padding:0;
}
.art-nav ul.art-menu ul span, .art-nav ul.art-menu ul span span
{
display: inline;
float: none;
margin: inherit;
padding: inherit;
background-image: none;
text-align: inherit;
text-decoration: inherit;
}
.art-menu ul a:link, .art-menu ul a:visited, .art-menu ul a:hover, .art-menu ul a:active, .art-nav ul.art-menu ul span, .art-nav ul.art-menu ul span span
{
text-align: left;
text-indent: 12px;
text-decoration: none;
line-height: 20px;
color: #1A1E1E;
font-size: 11px;
margin:0;
padding:0;
}
.art-menu ul li a:hover
{
color: #052333;
background-position: 0 -20px;
}
.art-menu ul li:hover>a
{
color: #052333;
background-position: 0 -20px;
}
.art-nav .art-menu ul li a:hover span, .art-nav .art-menu ul li a:hover span span
{
color: #052333;
}
.art-nav .art-menu ul li:hover>a span, .art-nav .art-menu ul li:hover>a span span
{
color: #052333;
}
....
I zamiast tego chcę w kodzie html mieć tylko:
Cytat:...
<div class="art-nav-center">
<div class="art-menu">
</div>
</div>
...
Mam nadzieję że dobrze mnie zrozumieliście.
Proszę o porady jak to zrobić najszybciej i funkcjonalnie. Bardzo cenie sobie każdą sugestię.
Zacząłem sam przerabiać kod css ale jak na razie nie wychodzi mi to najlepiej.
Pozdrawiam.
RE: [HTML/CSS] Łączenie DIV'ow i class - Pedro84 - 20-03-2011
Dlaczego chcesz się pozbyć poprawnej metody (lista) i zrobić to niepoprawnie (sam div)?
RE: [HTML/CSS] Łączenie DIV'ow i class - LordHammer - 20-03-2011
Zapomniałem o tym wspomnieć. Wszystko to chcę zrobić tylko dla tego że mam teraz CMS'a na którego będę wgrywał Lay'a i wstawiam znaczniki takie jak {menu}{content}{footer}.
W menu właśnie zamiast całego <ul class chcę wstawić diva abym mógł w niego wstawić {menu} gdzie dalej cms wstawi menu.
Dzięki za zainteresowanie Może ktoś mi w jakiś stopniu pomoże.
Pozdrawiam.
|