Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
problem s vertikalnim centiranjem

 
Post new topic   Reply to topic    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
Gibbo



Joined: 26 Jul 2006
Posts: 17
Location: localhost

PostPosted: 08.03.2012 23:53    Post subject: problem s vertikalnim centiranjem Add user to your forum ignore list Reply with quote

Gibbo wrote:
izrađujem izbornik, koji ima nekoliko mogucnosti, link na sliku bez teksta, link na slikom i tekstom i samo link na tekst

Problem mi je kod kombinacije slike i teksta u linku, text mi se pomjeri dolje, ne znam zasto

isprobao sam svakakve kombinacije (vertical-align: middle;, line-height: ?px; margin-top, top, .....) ali nesto krivo radim i nikako ne uspjevam


evo primjer (slike koje sam stavio su neke bezveze externi linkovi dimenzija 16x16)

Code:

<style>
.menu {
    background: none repeat scroll 0 0 #414141;
    font-family: Verdana;
    font-size: 12px;
    font-weight: bold;
    width: 100%;
}
.menu ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    z-index: 100;
}
.menu ul li {
    display: inline;
    float: left;
    position: relative;
}
.menu ul li a {
    background: none repeat scroll 0 0 #9D2231;
    color: white;
    display: block;
    padding: 8px 10px 5px;
}

.menu ul li a:link, .menu ul li a:visited {
    color: #FFFFFF;
}
.menu ul li a.selected {
    background: none repeat scroll 0 0 #585858;
    color: #FFFFFF;
    text-decoration: none;
}
.menu ul li a:hover {
    background: none repeat scroll 0 0 #585858;
    color: #FFFFFF;
    text-decoration: none;
}
.menu ul li ul {
    display: none;
    left: 0;
    position: absolute;
    visibility: hidden;
    width: 194px;
}
.menu ul li ul li {
    display: list-item;
    float: none;
}
.menu ul li ul li ul {
    top: 0;
}
.menu ul li ul li a {
    border-top-width: 0;
    font-family: Verdana;
    font-size: 12px;
    font-weight: normal;
    margin: 0;
    padding: 5px;
}


</style>
<div class="menu" id="menu1">
   <ul>
      <li><a href="/index.php"><img src="http://www.eclipse.org/forums/theme/EclipseTheme/images/top_home.png"></a></li>
      <li><a href="/index.php?="><img src="https://www.4yourtype.com/_1-2010-codebase/icon-cart-contact-phone.png">Kontakt</a></li>
      <li><a href="/index.php?=">Kontakt2</a></li>
   </ul>
</div>


Last edited by Gibbo on 10.03.2012 01:48; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Gibbo



Joined: 26 Jul 2006
Posts: 17
Location: localhost

PostPosted: 08.03.2012 23:54    Post subject: Re: problem s vertikalnim centiranjem Add user to your forum ignore list Reply with quote

dupli

Last edited by Gibbo on 10.03.2012 01:48; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 09.03.2012 10:14    Post subject: Add user to your forum ignore list Reply with quote

Nemoj koristiti img element u linku nego daj tom linku klasu i definiraj mu pozadinu CSS-om.
Code:
background: url(slika.gif) 0 50% no-repeat;

Možeš precizno namjestiti sličicu u pixelima umjesto u postocima, mada pixeli nisu valjani po W3C-u, ali radi u svim browserima.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Gibbo



Joined: 26 Jul 2006
Posts: 17
Location: localhost

PostPosted: 10.03.2012 01:47    Post subject: Add user to your forum ignore list Reply with quote

Što se tiče pozicioniranja to sam na ovaj način uspio ali pojavilo se nešto što mi se ne sviđa, kad pređem mišem preko izbornika koji ima sliku ne dobije a:hover boju pozadine, ali uz !important sam dobio, mada još nije savršeno sigurno je bolje nego što je bilo prije.
Javim se kako budem imao dodatnih pitanja.

hvala
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group