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

Detailed explanation of three methods of JS interception string

JS provides three methods for intercepting string...

A brief discussion on the synchronization solution between MySQL and redis cache

Table of contents 1. Solution 1 (UDF) Demo Case 2...

Application of mapState idea in vuex

Table of contents 1. Map method 2. Application ba...

Example code of html formatting json

Without further ado, I will post the code for you...

Five guidelines to help you write maintainable CSS code

1. Add a comment block at the beginning of the sty...

MySQL 5.7 generated column usage example analysis

This article uses examples to illustrate the usag...

js realizes horizontal and vertical sliders

Recently, when I was doing a practice project, I ...

Vue implements adding watermark effect to the page

Recently, when I was working on a project, I was ...

MySQL query sorting and paging related

Overview It is usually not what we want to presen...

Install Linux rhel7.3 operating system on virtual machine (specific steps)

Install virtualization software Before installing...

How to change the database data storage directory in MySQL

Preface The default database file of the MySQL da...

Centos7 installation of FFmpeg audio/video tool simple document

ffmpeg is a very powerful audio and video process...

Steps to install cuda10.1 on Ubuntu 20.04 (graphic tutorial)

Pre-installation preparation The main purpose of ...

Use Typescript configuration steps in Vue

Table of contents 1. TypeScript is introduced int...

Mysql practical exercises simple library management system

Table of contents 1. Sorting function 2. Prepare ...