0

Responsive

How to set image without it stretching whole html i only 375px part of that image but it creates this scroll bar

18th Jan 2024, 7:51 AM
Ayato Sakamaki
Ayato Sakamaki - avatar
7 Respostas
+ 1
19th Jan 2024, 4:42 PM
NextJS Boi
NextJS Boi - avatar
18th Jan 2024, 10:16 AM
Jan
Jan - avatar
0
Hey there Could you provide the link to your code?
18th Jan 2024, 5:55 PM
Amin Alizadeh
Amin Alizadeh - avatar
0
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600;700&display=swap'); * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'IBM Plex Sans', sans-serif; overflow: hidden; width: 375px; position: relative; } html { font-size: 10px; } .image { position: absolute; clip: rect(0px, 375px, 700px, 0px); display: block; }
19th Jan 2024, 11:51 AM
Ayato Sakamaki
Ayato Sakamaki - avatar
0
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <img class="image" src="./assets/bg-main-mobile.png" alt="Your Image"> </body> </html>
19th Jan 2024, 11:51 AM
Ayato Sakamaki
Ayato Sakamaki - avatar
0
I only want 375px part of that image to be visible without it stretching whole space and creating scroll bar
19th Jan 2024, 11:52 AM
Ayato Sakamaki
Ayato Sakamaki - avatar
0
I canr open it
19th Jan 2024, 6:24 PM
Ayato Sakamaki
Ayato Sakamaki - avatar