alignment - CSS: When to use right: 0px and when to use float: right? -
i learning css , wondering when use right: 0px;
, when use float: right;
. understand have set position
attribute in order able use right: 0px;
, wondering when use one?
i heard float
bad?
cheers.
if learning css, must use padding
, margin
whenever can, might take time master, keep things simple in relation overall flow of elements (in relation 1 another).
if cant desire result padding
, margin
, can use float
property (float: right;
, float: none;
, ...), use when want 2 elements share horizontal space.
to sum up:
1. wondering when use one?
use padding
, margin
first option, , if not getting desire result use float
, , if still not want, can try advanced css features such flexbox , table layout.
2. heard float bad?
well not bad @ all, can easy overuse, , make code more complicated.
Comments
Post a Comment