vendredi 23 avril 2021

Aligning a youtubeicon to the center

There is a page Site view. There is a code (I want to center the image <img class="youtube__icon-play" src="../img/Vector.png">)

body {
    margin: 0;
    padding: 0;
}

.globalcontainer {
    margin-top: 0px;
    margin-right: 4%;
    margin-bottom: 0px;
    margin-left: 4%;
    height: 100%;
}

.header > .header__text {
position: relative;
width: 93px;
height: 24px;
left: 0;
margin-top: 129px;
margin-bottom: 20px;

font-family: TT Norms;
font-style: normal;
font-weight: bold;
font-size: 24px;
line-height: 100%;
/* identical to box height, or 24px */


color: #000000;
}

/*
.header__buttons {
    left: 0;
    top: 193px;
}
*/


.header__button {
    width: 75px;
    height: 30px;
    border-radius: 4px;
    background-color: #fff;
    margin-right: 1.75%;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.header__buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 7px 15px 7px 0px;
    /*margin-right: 10%;*/
}

.content {
    width: 100%;
}

.cardexample {
    width: 100%;
}

.mobileimage img{
    max-width: 100%;
    height: auto;
}

.mobiles {
    max-width: 100%;
}

.content__title {
    font-family: TTNorms-Medium;
    font-style: normal;
    font-weight: bold;
    font-size: 18px;
    line-height: 21.6px;
    
    margin: 0.3% 15px 0 15px;
}

.crashvideo {
    width: 115px;
    height: 30px;
    border-radius: 4px;
    margin-top: 15px;
    
    background-color: #5f3ec0;
    color: #ffffff;
}

.youtube__icon-play {
    margin-left: 30.5px;
    margin-top: 20.5px;
    
    align: center;
}
<html>
<head>
<!-- <link rel="stylesheet" href="testsite.css">-->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Test Example</title>
<link rel="stylesheet" type="text/css" href="../css/mobile.css" media="screen and (min-width: 320px) and (max-width: 639px)"></link>
<link rel="stylesheet" type="text/css" href="../css/tablet.css" media="screen and (min-width: 640px) and (max-width: 1023px)"></link>
<link rel="stylesheet" type="text/css" href="../css/desktop.css" media="screen and (min-width: 1024px) and (max-width: 1920px)"></link>
<script type="text/javascript" src="http://code.jquery.com/jquery-3.6.0.min.js"></script>

</head>
<body>
    <div class="globalcontainer">
        <div class="header">
                <div class="header__text">
                    Обзоры
                </div>
                <div class="header__buttons">
                    <!-- <span> -->
                        <button class="header__button">Все</button>
                        <button class="header__button">Видео</button>               
                        <button class="header__button">Текст</button>               
                        <button class="header__button">Обзоры</button>
                        <button class="header__button">Сравнения</button>
                        <button class="header__button">Краш видео</button>
                        <button class="header__button">Распаковка</button>
                    <!-- </span> -->
                </div>
        </div>      
        <div class="content">       
                <div class="cardexample">
                    <div class="mobileimage">
                        <img class="mobiles" src="../img/mobileimage.png">
                    </div>
                    <div class="content__title">
                        Iphone 11, почему такой же как и Pro Max, может быть большим в 3 строки вот так
                        <span class="video__icon">
                            <span>
                                <button class="crashvideo">Краш видео</button>
                            </span>
                            <span>
                                <img class="youtube__icon-play" src="../img/Vector.png">
                            </span> 
                        </span>
                    </div>
                </div>
                <div class="cardexample">
                </div>
                <div class="cardexample">
                </div>
                <div class="cardexample">
                </div>
        </div>      
    </div>
<script type="text/javascript" src="jsactions.js"></script>
</body>
</html>

It is displayed as in the picture below (I want to center the image <img class="youtube__icon-play" src="../img/Vector.png">)

Youtube icon

How to achieve the display as on the 1st link? (I want to center the button)




Aucun commentaire:

Enregistrer un commentaire