I have two divs in my website,one is left side and other is right side.
But client said don't use float:right
.So i used margin:left
What is the plus point of not using float:right
? margin-left
or float:right
,
or am I wrong? Please help me.
#left
{
float:left;
width:200px;
}
#right
{
float:right;
width:200px;
}
or
#left
{
float:left;
width:200px;
}
#right
{
margin-left:250px;
width:200px;
}
I imagine it is to do with the order of the markup. In principle, you should write all your markup first, so it makes sense without any css, and then add css rules afterwards.
If you need to move your markup around to satisfy the css conditions, you might be damaging the search-engine-optimisation, accessibility, or readability and clear structure of your code.
If you float something right, sometimes you need to put the element first in the markup, even though it appears visually second.
This is of course speculation, and as Marcus Aurelius wrote about in his book meditations - it is more or less a waste of time trying to understand another person (in this case your client) as you can never truly succeed, only fool yourself into thinking you fully understand them and their motivations. Instead, you should concern yourself with making sure your own motivations, and actions are correct - so make sure you know when and when not ot float things left or right (which you are on the path to doing now), and reveal these truths to your client.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With