मुझे बंद करें और जानकारी बटन को फिर से डिज़ाइन करने में मदद चाहिए।

यह बटन अब इस तरह दिखता है: यहां छवि विवरण दर्ज करें

यह बैनर पर इस तरह दिखना चाहिए: यहां छवि विवरण दर्ज करें

बटन का सीएसएस कोड:

 body {
        margin: 100px;
    }

    .banner-buttons {
        position: relative;
        font-size: 13px;
        width: 120px;
        background-color: white;
    }

    .adsByNano {
        display: block;
        float: right;
        margin-right: 50%;
        color: #d075f4;
    }

    a.infoLink:hover .adsByNano {
        display: inline-block;
        color: #d075f4;
    }

    .closeBtn {
        display: inline-block;
    }

    .closeBtn:hover {
        cursor: pointer;
        color: #d075f4;
    }

बटनों का HTML कोड:

 <div id="main">
    <div class="nanoSaturnBanner">
        <div class="banner-buttons">
            <label class="adsByNano">Ads by Nano</label>
            <a class="infoLink" href="http://nanointeractive.com/privacy" target="_blank">
                <i class="fas fa-info-circle"></i>
            </a>
            <div class="closeBtn" onclick="removeHeader()">
                <i class="far fa-window-close"></i>
            </div>
        </div>
    </div>

समाधान के बारे में कोई विचार?

0
James Delaney 9 मई 2018, 11:41

2 जवाब

सबसे बढ़िया उत्तर

ये कोशिश करें

body {
    margin: 100px;
}
.nanoSaturnBanner {
  border: 1px solid #ccc;
  background-color: #EDEBED;
  padding: 10px;
  position: relative;
}
.banner-buttons {
    position: absolute;
    font-size: 13px;
    background-color: white;
    right: 0;
    top: -10px;
    display: flex;
    flex-wrap: wrap;
    padding: 2px 3px;
    border-radius: 4px;
}
.banner-buttons .closeBtn,
.banner-buttons .infoLink {
  margin-left: 5px;
  color: #77CDE0;
  font-size: 12px;
}

.banner-buttons .closeBtn:hover {
  color: #77CDE0;
}

.adsByNano {
    display: block;
    float: right;
    color: black;
}

a.infoLink:hover .adsByNano {
    display: inline-block;
    color: #d075f4;
}

.closeBtn {
    display: inline-block;
}

.closeBtn:hover {
    cursor: pointer;
    color: #d075f4;
}
<link href="https://use.fontawesome.com/releases/v5.0.12/css/all.css" rel="stylesheet"/>
<div id="main">
    <div class="nanoSaturnBanner">
        <div class="banner-buttons">
            <label class="adsByNano">Ads by Nano</label>
            <a class="infoLink" href="http://nanointeractive.com/privacy" target="_blank">
                <i class="fas fa-info-circle"></i>
            </a>
            <div class="closeBtn" onclick="removeHeader()">
                <i class="fas fa-times"></i>
            </div>
        </div>
      Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    </div>
1
Ramy Ragab 9 मई 2018, 12:04

यह रहा...

body {
    margin: 20px;
}
.nanoSaturnBanner {text-align: right;}
.banner-buttons {
    position: relative;
    font-size: 13px;
    display: inline-block;
    background-color: white;
}

.banner-buttons:hover .adsByNano {
  display: inline-block;
}

.adsByNano {
  display: none;
    vertical-align: middle;
    color: #d075f4;
}

a.infoLink:hover .adsByNano {
    display: inline-block;
    vertical-align: middle;
    color: #d075f4;
}

.closeBtn {
    display: inline-block;
}

.closeBtn:hover {
    cursor: pointer;
    color: #d075f4;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.12/css/all.css" integrity="sha384-G0fIWCsCzJIMAVNQPfjH08cyYaUtMwjJwqiRKxxE/rx96Uroj1BtIQ6MLJuheaO9" crossorigin="anonymous">
<div id="main">
    <div class="nanoSaturnBanner">
        <div class="banner-buttons">
            <label class="adsByNano">Ads by Nano</label>
            <a class="infoLink" href="http://nanointeractive.com/privacy" target="_blank">
                <i class="fas fa-info-circle"></i>
            </a>
            <div class="closeBtn" onclick="removeHeader()">
                <i class="far fa-window-close"></i>
            </div>
        </div>
    </div>
1
Kumar 9 मई 2018, 12:18