width30% + width70% is not 100%?


#1

Hey Guys.. pls HELP

i got the first div> set to float:left, the second div>to float:right and the width is 30% and 70%. Why the Heck are these two think not sitting next to each other but they are overlapping a bit...... :confused:

i tried to set margin and padding to 0px .. nothing is working ..

thx for the Answer!!


#2

By default body has a margin of 8px, try adding;

body {
  margin: 0;
}

for more help, you are going to need to provide me with code


#3

nope.. its still overlapping, i tryed to set the padding to 0 aswell.. i have no idea what is going on here :confused:


#4

Then provide me your code, i can't keep guessing what the problem is? Do you have borders? I can't list them all, please post your code


#5

i got it, the problem were the borders, i set them to 0 and it is sitting nexxt to each other :smile: i am sooo happy :smiley:
THX stetim94 anyway!!


#6

or you could have added:

div {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

this would make padding and border part of the width of your element. This way you can still have a border.


#7

I finished the html&css few days ago and now i try to understand all the processes which i have been doing, where do i learn things like you posted now, that with the borders .. thats really important to know i think!!

thx


#8

I picked up many different things from many different places. MDN has extensive documentation and i have done many courses online, codecademy isn't the only one. But this is not suitable for the forum, if you have questions, send me a message