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 positionattribute 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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -