milkokv Posted August 7, 2017 Report Share Posted August 7, 2017 imam problem sa displey:inline-block.Hocu dva div-a jedan pored drugog i oba da zauzimaju po polovinu ekrana #pola1 { background-color:red; height:50px; width:50%; display:inline-block; } #pola2 { background-color:black; height:50px; width:50%; display:inline-block; <body> <div id="pola1"> </div <div id="pola2"> </div> </body> stvarno ne znam sto ovo nece da radi Link to comment Share on other sites More sharing options...
vili Posted August 8, 2017 Report Share Posted August 8, 2017 Inline-block elementi su i dalje inline elementi i ukoliko u html-u nisu odmah jedan iza drugog, renderuje se space izmedju njih, tako da 50% ne radi posao. Postoji vise nacina da se resi ovaj "problem" (u principu povo nije problem vec neadekvatno koriscenje css-a). Neke mozes da pogledas ovde: https://davidwalsh.name/remove-whitespace-inline-block Ali u konkretnoj situaciji, ispravnije je koristiti float nego inline-block, ili ukoliko browser support nije problem, koristiti flexbox Link to comment Share on other sites More sharing options...
milkokv Posted August 8, 2017 Author Report Share Posted August 8, 2017 e to mi nikad ne bi palo na pamet.hvala puno Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now