+ 7
Three divs, three links. How to put the links perfect in the center of each div?
Hi guys, I just wrote this code down (see comments). Can you check this? Is this a good way or a bad way? And How do I get my links perfectly in the mid of each div container? Cheers, Robert https://code.sololearn.com/WlLUWu5GpB61/?ref=app
12 Réponses
+ 11
A simple way is here
https://code.sololearn.com/WfT1O33lbibd/?ref=app
+ 8
Just to make one of the multiple ways to do that. :)
https://code.sololearn.com/W8Ajv2TVLs9D/?ref=app
+ 7
+ 7
Fixed, now you can click the link only inside the black border (that you can also remove), anyway that's not the best way to center elements, you can re-write the code without use the position property.
+ 7
I think that css flexbox model would be better suited for making your layout...
Check the rewrote Css rules in this code (removed definition disabled but kept commented):
https://code.sololearn.com/W7MxvGCcAT2k/#css
+ 3
Hi Maz, this works perfect, Thank you!
But it has one negative side aspect. The box of e.g. "google" is clickable from the left side till the right side. Is there an other way to solve this?
+ 2
Maybe this is a better explanation. The box of every a element is 10px high and now >1000px width. And everywhere where the pixel are, you can click on the box and get a restriction to the link
+ 2
Nice!
I would rewrite the code. I only need to change the css, right?
What I use instead of position?
+ 2
I'll will check it out in 30 minutes and give u a reply :)
+ 2
Well done mate, its working perfect. Thank you very much! :)
+ 1
just use
text-align: center;
in the CSS. do they not teach you this stuff?
+ 1
My thoughts exactly @Happy Panda Skulls
Although, by looking at SergeantChad's profile he hasn't had much experience with using CSS, for someone with his experience he did very well, kudos to you @SergeantChad Well done.