M
M
Mikhail Lyalin2016-06-08 10:38:52
css
Mikhail Lyalin, 2016-06-08 10:38:52

3 types of CSS image placement?

The site uses 3 different types of graphics placement:

  • hspace="10" vspace="10" align="left"
  • hspace="10" vspace="10" align="right"
  • no positioning at all.

What is the most compact way to write generic CSS and call a specific type for a specific image on a page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2016-06-08
@mr_jok

css

.image-margin {margin: 10px;}
.pull-right {float: right;}
.pull-left {float: left;}

html
<img src='путь/до/картинки' class="image-margin pull-right">
<img src='путь/до/картинки' class="image-margin pull-left">
<img src='путь/до/картинки' class="pull-left">
<img src='путь/до/картинки' class="pull-right">
<img src='путь/до/картинки' class="image-margin">

I
Igor Voronov, 2016-06-08
@ivoronov

All of these attributes are deprecated.
floats will save you.
>> How to most compactly write a generic CSS
Selector by class.
>> calling a specific type for a specific image on the page
In what sense is the call? If you have the required css file connected and it contains properties for the required selectors, they will be applied.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question