N
N
Nikita Ivanov2013-11-25 17:00:43
css
Nikita Ivanov, 2013-11-25 17:00:43

Scalable and hideable website background

Good afternoon!
Such a problem:
you need to position the image on the site in such a way that it is located in the center of the right side (there is an empty field on the site)
so that at high resolution it is 700px high, at lower resolutions it is hidden, and on mobile devices it is hidden altogether.
what i tried is wrong

first option
body {background-image: url(http://prosto2.ru/1.jpg); background-position: center right; background-repeat:no-repeat; background:size: 123px auto; background-attachment: fixed; }

then I tried to set the min-height / max-height to the picture, but only an almost correct position occurs, i.e. thus it is not located in the center of the vertical and on the right edge of the horizontal
second option
#bgimg { height:80% position:fixed; right: 1px; }

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Y
Yuri Lobanov, 2013-11-25
@rekurt

The task is of course clear only in general terms. Insert a fixed block in the upper right corner, make it background-size: contain and resize the block with styles depending on the size of the viewport.

A
Artur Smirnov, 2013-11-26
@artursmirnov

You can also try using CSS3 Media Queries. Here's a great article on using them: Responsive and Mobile Design with CSS3 Media Queries

M
Moe Green, 2014-12-10
@mQm

if you do not take into account the slider-stripes at the top, then I would choose neither the first nor the second, and the third - owl carousel. lately I prefer to use it.
and so - until the issue is resolved (

A
aen, 2014-12-10
@aen

kenwheeler.github.io/slick

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question