Html+CSS floating advertisement strip implementation

Html+CSS floating advertisement strip implementation
1.html part

Copy code
The code is as follows:

<!DOCTYPE html>
<html>
<head>
<title>blog_floatdiv.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<link rel="stylesheet" type="text/css" href="./css/blog_floatdiv.css">
<script type="text/javascript" src="./js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="./js/blog_floatdiv.js"></script>
</head>
<body>
<div id="fdiv">
I am a floating div <img src="images/logingb.png">
</div>
Floating divs
floating div floating div floating div floating div floating div floating div floating div floating div
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
floating div floating div floating div floating div floating div floating div floating div floating div floating div
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs
Floating divs

</body>
</html>

2.css part

Copy code
The code is as follows:

#fdiv{
width:200px;
height: 500px;
background: yellow;
position: fixed;
top: 128px;
_position: absolute;
_top: expression(eval(document.documentElement.scrollTop));
}
#fdiv img{
margin-left: 190px;
margin-top: 470px;
}

3.js part

Copy code
The code is as follows:

$(function() {
$("#fdiv img").click(function(){
$("#fdiv").hide();
});
});

<<:  An article tells you how to write a Vue plugin

>>:  CSS Back to Top Code Example

Recommend

Usage and best practice guide for watch in Vue3

Table of contents Preface🌟 1. API Introduction 2....

iFrame is a great way to use it as a popup layer to cover the background

I have been working on a project recently - Budou ...

Guide to using env in vue cli

Table of contents Preface Introduction-Official E...

How to pop up a temporary QQ dialog box to chat online without adding friends

In fact, this is very simple. We add an a tag to ...

A brief discussion on tags in HTML

0. What is a tag? XML/HTML CodeCopy content to cl...

How to implement n-grid layout in CSS

Common application scenarios The interfaces of cu...

Implementation of nginx flow control and access control

nginx traffic control Rate-limiting is a very use...

Difference between HTML ReadOnly and Enabled

The TextBox with the ReadOnly attribute will be di...

MySQL tutorial data definition language DDL example detailed explanation

Table of contents 1. Introduction to the basic fu...

Optimized record of using IN data volume in Mysql

The MySQL version number is 5.7.28. Table A has 3...

Detailed explanation on how to install MySQL database on Alibaba Cloud Server

Preface Since I needed to install Zookeeper durin...

WeChat applet uses canvas to draw clocks

This article shares the specific code of using ca...

Introduction to ufw firewall in Linux

Let's take a look at ufw (Uncomplicated Firew...

IDEA complete code to connect to MySQL database and perform query operations

1. Write a Mysql link setting page first package ...