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

Implementation of positioning CSS child elements relative to parent elements

Solution Add position:relative to the parent elem...

NULL and Empty String in Mysql

I recently came into contact with MySQL. Yesterda...

Docker deploys Laravel application to realize queue & task scheduling

In the previous article, we wrote about how to de...

Detailed explanation of setting Context Path in Web application

URL: http://hostname.com/contextPath/servletPath/...

mysql solves the problem of finding records where two or more fields are NULL

Core code /*-------------------------------- Find...

Pure CSS3 to create page switching effect example code

The one I wrote before is too complicated, let’s ...

XHTML 2.0 New Features Preview

<br />Before browsers can handle the next ge...

Solution for Vue routing this.route.push jump page not refreshing

Vue routing this.route.push jump page does not re...

Nginx source code compilation and installation process record

The installation of the rpm package is relatively...

PNG Alpha Transparency in IE6 (Complete Collection)

Many people say that IE6 does not support PNG tra...

vue-pdf realizes online file preview

This article example shares the specific code of ...

Implementation of dynamic particle background plugin for Vue login page

Table of contents The dynamic particle effects ar...

Learn Hyperlink A Tag

ask: I have styled the hyperlink using CSS, but i...

Detailed Analysis of the Differences between break and last in Nginx

Let's talk about the difference first last, t...