Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Web программирование > HTML и CSS
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 19.03.2022, 23:14   #1
AleksandraMuraveva
Новичок
Джуниор
 
Регистрация: 19.03.2022
Сообщений: 1
Вопрос Как изменить очень длинную картинку

file:///C:/Users/gjkbyf/Desktop/HTML/astrolog/index.html - запуталась со своим творением, может кто-то подсказать как сделать так чтобы картинка не уходила по горизонтали
html:
Код:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="styles.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&family=Roboto:wght@300&family=Rubik:ital,wght@1,300;1,400&family=Source+Serif+4:ital,wght@0,600;1,700&display=swap" rel="stylesheet">
</head>
<body class="welt" src="гороскоп.jpg"alt="horoscope"></body>
<nav class="nav">
    <a  class="top am"href="about.html">Обо мне</a>
    <a class="am" href="servises.html">Мои услуги</a>
    <a class="am" href="reviews.html">Отзывы</a>
    <a class="am"href="contacts.html">Контакты</a>
</nav>
<br>
    <div class="heading">
        <div class="ast">
        <h1 class="je">ИРИНА ПЕТРУХИНА</h1>
        <h3 class="ice">профессиональный астролог</h3>
            <li>
            <ul class="ice wap">☄ Консультация астролога</ul>
            <ul class="ice wap">☄ Натальная карта, личный гороскоп</ul>
            <ul class="ice wap">☄ Гороскоп на выбор профессии</ul>
            <ul class="ice wap">☄ Консультации в бизнесе</ul>
            <ul class="ice wap">☄ Значимые даты в гороскопе</ul>
            </li>
        <a href="https://wa.me/79700000000" target="_blank"><button class="bt btn">Записаться на консультацию</a></button>
        </div>
        <br>
    </div>
    <div class="my">
            <video autoplay muted loop id="waitVideo"playsinline>
                <source src="Universe - 883.mp4" type="video/mp4">
              </video>
             </div> 
             <div class="strep">
    <p class="maises"><i>Моя миссия<i></p>
    <br>
    <div class="maris">
    <p>помочь найти себя и свое предназначение ��
    Со мной ты станешь счастливее��</p>
    </div>
    <div class="ded">
        <h3 class="am">Как воспользоваться моими услугами</h3>
        </div>
        <br>
        <div class="pet">
        <div class="aple">
        <p class="ice">��Свяжитесь со мной удобным для вас способом:по телефону,эл.почте или WhatsApp</p>
        </div>
        <br>
        <div class="aple">
        <p class="ice">��Я детально проработаю ваш запрос,найду наилучшее решение.</p>
        </div>
        <br>
css:
#myVideo{
width: 400px;
height:400px;
border-radius: 50%;
object-fit: cover;
}
body{
    margin: 0 auto;
}
.welt {
    background:url(гороскоп.jpg);  
    background-attachment: fixed;
    background-repeat: repeat-x;
}
.nav{
    display: flex;
    justify-content: flex-end;
    padding: 20px;
}
.am{
    text-decoration: none;
    color:#fdacef;
    text-transform: uppercase;
    padding: 20px;
    font-weight: bold;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}
.am:hover{
    color:#292C6D;
    transition-duration: 1s;
}
.top{
    margin-right: auto;
    font-family: 'Montserrat', sans-serif;
}
.heading{
    display: flex;
    justify-content: flex-start;
    margin-left:150px ;
}
.ice{
    color: white;
    font-family: 'Montserrat', sans-serif;
    align-self: center;
    justify-items: center;
    text-align:center;
}
.wap{
    display: flex;
    text-align: center;
}
.je{
    font-size: 40px;
    color:#fdacef;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
}
.bt{
        text-transform: uppercase;
        text-decoration:none;
        font-size: 12px;
        padding: 10px;
        background-color:#fdacef;
        border-radius: 20px;
        cursor: help;
        color: #1C6DD0;
        font-family: 'Montserrat', sans-serif;
        text-align: center;
    }
    .bt:hover{
        background-color:#292C6D;
    transition-duration: 1s;
    }
.ast{
    display: flex;
    flex-direction: column;
    justify-content:flex-start;
}
.about{
    background:url(гороскоп.jpg);  
    background-attachment: fixed;
    background-repeat: repeat-x;
}
.praim{
    display: flex;
    flex-direction: column;
    margin-top: 100px;
    width: 400px;
}
.irina{
    margin-top: 50px;
    margin-left: 70px;
    border-radius: 20px;
}
.nice{
text-decoration:underline;
color: white;
margin-left: 20px;
font-size: 25px;
font-family: 'Montserrat', sans-serif;
}
.wain{
    margin-left: 20px;
    font-family: 'Montserrat', sans-serif;
}
.jpg{
    border-radius: 20px;
}
.ser{
    display: flex;
    justify-content: center;
}
.gor{
    display: flex;
    flex-direction: column;
    justify-content:space-around;
    font-family: 'Montserrat', sans-serif;
}
.tor{
   align-items:center;
   width: 300px;
   margin-left: 40px;
   padding: 10px;
   font-family: 'Montserrat', sans-serif;
}
.zod{
    display: flex;
}
.grin{
    display: flex;
    justify-content: space-between;
}
.wiw{
    display: flex;
    justify-content: center; 
}
.ero{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
    border: solid 2px;
    border-color: #fdacef;
    border-radius: 20px;
    background-color:#1a082e;
}
.rev{
    display: flex;
    justify-content: space-between;
}
.vev{
    display: flex;
    justify-content: center;
}
.wh{
    color:white ;
    font-size: 30px;
    transition-duration: 3s;
    
}
.contacts{
    display: flex;
    flex-direction: column;
    align-items: center;
}
.con{
    font-size: 70px;
    color:#fdacef;
}
.wh:hover{
    color:#292C6D;
    transition-duration: 1s;
}
.form{
    display: flex;
    flex-direction: column;
    align-self: center;
    justify-content: center;
    width: 400px;
    top: 50%;
 left: 50%;
 margin-top: 20px;
 margin-left: 450px; 
}
.ded{
    display: flex;
   margin-top: 80px;
   font-size: 70px;
}
.pet{
    display: flex;
    justify-content: space-around;
    margin-right: 100px;
}
.aple{
    display: flex;

    justify-content: space-between;
    width: 250px;
    border: solid;
    border-color: #fdacef;
    border-radius: 20px;
    font-size: 20px;
    padding: 10px;
    margin-right: 100px;
}
.ics{
    color: white;
    padding: 10px;
    font-family: 'Montserrat', sans-serif;
}
h3{
    font-size: 20px;
}
.ses{
    display: flex;
    justify-content: center;
    font-size: 40px;
    color: #fdacef;
    padding: 20px;
}
.my{
    width:179;
    height: 50%;
     z-index: -3;
     top:0;
position: absolute;
}
.maris{
    font-size: 30px;
     color: white;
     width: 600px;
     padding: 20px;
     margin-left: 100px;
     margin-top: 100px;
}
.maises{
    font-size:40px ;
    color: white;
    padding: 20px;
    margin-left: 300px;
    margin-top: 150px;
    text-align:center;
    
}
.strep{
    display: flex;
    justify-content: space-between;
    align-self: center;
    margin-top: 100px;
}
.forma{
    display: flex;
    justify-content: space;
}
.video{
    display: flex;
    justify-content: flex-start;
    margin-top: 100px;
    margin-left: 80px;
}
.tet{
    display: flex;
    flex-direction: column;
    margin-right: 80px;
    margin-left: 40px;
}
Если кто-то сможет помочь буду очень благодарна...
AleksandraMuraveva вне форума Ответить с цитированием
Старый 20.03.2022, 01:16   #2
Alar
Александр
Администратор
 
Аватар для Alar
 
Регистрация: 28.10.2006
Сообщений: 17,501
По умолчанию

Вот эта тема должна помочь

https://programmersforum.ru/showthread.php?t=333514

например

Цитата:
Код:
<style type="text/css">

.css-adaptive {
display: block;
max-width: 100%;
height: auto;
}

</style>

<img src="https://programmersforum.ru/kartinka.gif" class="css-adaptive">
изменяет длину картинки до размера экрана, какая бы она не была.
Alar вне форума Ответить с цитированием
Старый 03.04.2022, 13:22   #3
terso9
Новичок
Джуниор
 
Регистрация: 02.04.2022
Сообщений: 3
По умолчанию

По, хорошему картинку "завернуть" в тег div с помощью css св-ва background-image.
Т.е. устанавливаем для div св-ва css:
Код:
width: 70%;
height: 70%;
background-image: url(bg.png);
terso9 вне форума Ответить с цитированием
Старый 27.05.2022, 06:24   #4
Tom_Bergersen
Новичок
Джуниор
 
Регистрация: 26.05.2022
Сообщений: 9
По умолчанию

чтобы картинка не выходила за границы, нужно ее обернуть в блок например div, а потом уже можно задать width и height по выбору
Tom_Bergersen вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Как изменить картинку на кнопке комбобокса? magnuz WPF, UWP, WinRT, XAML 0 15.12.2021 09:26
Нужен совет - как в програмке изменить по мелочи картинку и название организации zaplutkus Помощь студентам 9 30.04.2014 15:50
Как получить картинку при наведении на другую картинку (ссылку) seeker1 JavaScript, Ajax 8 04.07.2010 19:42
Изменить фон, не закрасив картинку. Iamloli Мультимедиа в Delphi 18 21.01.2010 08:24
Как прочесть длинную строку из файла? delphyok Паскаль, Turbo Pascal, PascalABC.NET 1 13.05.2009 08:51