Hi there! I need to do with slides pdf to html, height and width that varied proportionally. Now I’ve done statically width 849 and height 600 pixels. How to make it adaptive?
The first option which I think is
@ media screen and (min-width: 850px) and (max-width: 860px) {
** . welcome {height: 608px;}}
@ media screen and (min-width: 860px) and (max-width: 870px) {
** . welcome {height: 616px;}}
@ media screen and (min-width: 870px) and (max-width: 880px) {
** . welcome {height: 623px;}}
@ media screen and (min-width: 880px) and (max-width: 890px) {
** . welcome {height: 630px;}}
@ media screen and (min-width: 890px) and (max-width: 900px) {
** . welcome {height: 637px;}}
@ media screen and (min-width: 900px) and (max-width: 950px) {
** . welcome {height: 672px;}}
@ media screen and (min-width: 950px) and (max-width: 1000px) {
** . welcome {height: 708px;}}
@ media screen and (min-width: 1000px) and (max-width: 1100px) {
** . welcome {height: 778px;}}
@ media screen and (min-width: 1100px) and (max-width: 1200px) {
** . welcome {height: 849px;}}
I calculated proportions - height and width
2. Another option is js, which also changes proportionally, but I want to do without a js, only css
How can this be solved?
Slides with text, pictures and backgrounds
You lost me a bit there as I don’t know anything about pdfs. Do you have a link to what you have so far so we can see exactly what you mean?
If you are talking about images in an html page and you want to make them responsive then you can set their max-width:to 100% and their height to auto and they will scale with the page/container and maintain their aspect ratio. Something like the image in this demo.
However, I feel you may be talking about something else though so a link would help
Note that you would rarely use a succession of media queries like you have shown to accomplish this effect unless of course there was absolutely no other option.
I also put the code here http://codepen.io/olexandr/pen/GtBsc
Now it is very flexible and varies proportionally if the picture is at full height.
But the height of the slide is not all the images. How to make a slide with a second-class portfolio-slide2 was the height of the first? It is not the image across the top.
Need to slide all were the same height.
Do you mean that you want the pictures to all be the same width and height but still to maintain their aspect ratio?
If so then this would be easy using a background image as you just set the width and height of the container and then set the background-image to ‘cover’ (e.g. background-size:cover). It’s hard to tell though as I can’t see what you were aiming for with that code especially as there is no slider implemented in that example. Perhaps you can clarify a little more as to how you want this to work and what should happen.
If you are building a JS slider then it may be worth using one of the many free versions around as there is no point in re-inventing the wheel unless you have some new requirement.
Hi
No it’s not JS slider.It seems pdf document.
I need to make it as in this example http://codepen.io/paulobrien/full/Jphtq/
Only when the picture is on the background, because I have such pages have no images, only background image
Apologies, maybe its just me, but I seem to understand less now about what you want to do than when we started:)
Can we start again with a break down of what you are trying to achieve? Maybe a drawing of the final result as I don’t see much logic in your codepen which looks like some randomly placed images in floated columns.
Before, I can offer specific help I really need what type of effect you are trying to achieve and how the end result should look.
(Maybe someone else can jump in on the thread if they have an idea of what you need.)
Hi
Thank you for your message http://codepen.io/olexandr/pen/FhrLo
I need to block were the same height and width and proportionally changed, I did it with the help of images.
But this method is negative, all block need the same image.
How else can it do?