Home Web Front-end HTML Tutorial My project 8 css attributes to realize the reader rearrangement function_html/css_WEB-ITnose

My project 8 css attributes to realize the reader rearrangement function_html/css_WEB-ITnose

Jun 24, 2016 am 11:57 AM
Function Attributes read project

I believe everyone is familiar with the novel reader, so how is it implemented? Let me share some experiences here.

First of all, in my idea, when formulating multiple pages and realizing the rearrangement function, you may need to use an attribute of CSS3: column-count:3 (multiple columns). The idea is like this, also I don’t know if it’s right or not. Use HTML5 CSS3 to write a readable text, and then use the column-count attribute to divide it into columns. On the mobile terminal, then a book is equivalent to a page, and each page is equivalent to a column, and By changing the value of column-count, the rearrangement function is implemented. Not much to say about sharing sample code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>webkit-column测试</title><style type="text/css">body {background: #FFFFFF;}strong {color:#ff0000;}p {margin:0;text-indent:2em;}* {-webkit-transition: all 200ms linear;}#control {position: relative;z-index: -1;}</style></head><body><script type="text/javascript">window.onload = function() {	var c_box = document.getElementById("control");		var gCount = document.getElementById("get_count");	var col_num = document.getElementById("column_num");	col_num.onchange = function() {		gCount.innerHTML = "<style>.c_count { -webkit-column-count:" + col_num.value + ";}</style><strong>" + col_num.value + "</strong>栏";		c_box.style.zIndex = "1";	}		var gGap = document.getElementById("get_gap");	var col_gap = document.getElementById("column_gap");	col_gap.onblur = col_gap.onchange = function() {		gGap.innerHTML = "<style>.c_count { -webkit-column-gap:" + col_gap.value + ";}</style><strong>" + col_gap.value + "</strong>";	}		var col_rule_c = document.getElementById("column_rule_color");	var col_rule_v = document.getElementById("column_rule_va");	var col_rule_t = document.getElementById("line_type");	var gRule = document.getElementById("get_rule");		col_rule_t.onchange = function() {		if(col_rule_c.value == undefined || col_rule_v.value == ""){			col_rule_v.value = "1px";			col_rule_c.value = "#FF0000";		}		gRule.innerHTML ="<style>.c_count { -webkit-column-rule:" + col_rule_v.value + " " + col_rule_c.value + " " + col_rule_t.value + ";}</style><strong>-webkit-column-rule:" + col_rule_v.value + " " + col_rule_c.value + " " + col_rule_t.value + "</strong>";	}	col_rule_c.onchange = function() {		if(col_rule_t.value == "" || col_rule_v.value == ""){			col_rule_v.value = "1px";			col_rule_t.value = "solid";		}		gRule.innerHTML ="<style>.c_count { -webkit-column-rule:" + col_rule_v.value + " " + col_rule_c.value + " " + col_rule_t.value + ";}</style><strong>-webkit-column-rule:" + col_rule_v.value + " " + col_rule_c.value + " " + col_rule_t.value + "</strong>";	}	col_rule_v.onchange = function() {		if(col_rule_t.value == "" || col_rule_c.value == undefined){			col_rule_c.value = "#FF0000";			col_rule_t.value = "solid";		}		gRule.innerHTML ="<style>.c_count { -webkit-column-rule:" + col_rule_v.value + " " + col_rule_c.value + " " + col_rule_t.value + ";}</style><strong>-webkit-column-rule:" + col_rule_v.value + " " + col_rule_c.value + " " + col_rule_t.value + "</strong>";	}		var cBI = document.getElementById("column_break_inside");	var gBI = document.getElementById("get_break_inside");	var show_b_v = "auto";	var show_b_v_a = "avoid";	cBI.onchange = function() {		if(this.value != 0){			gBI.innerHTML = "<style>.c_count p:nth-child(" + this.value + ") {-webkit-column-break-inside: " + show_b_v_a + ";}</style><strong>第" + this.value + "行必须在一栏中 -webkit-column-break-inside: " + show_b_v_a + "</strong>";		}else{			gBI.innerHTML = "";		}	}		var cBB = document.getElementById("column_break_before");	var gBB = document.getElementById("get_break_before");	var show_bb_v = "auto";	var show_bb_v_a = "always";	cBB.onchange = function() {		if(this.value != 0){			gBB.innerHTML = "<style>.c_count p:nth-child(" + this.value + ") {-webkit-column-break-before: " + show_bb_v_a + ";}</style><strong>第" + this.value + "行前开始断开 -webkit-column-break-before: " + show_bb_v_a + "</strong>";		}else{			gBB.innerHTML = "";		}	}		var cBA = document.getElementById("column_break_after");	var gBA = document.getElementById("get_break_after");	var show_ba_v = "auto";	var show_ba_v_a = "always";	cBA.onchange = function() {		if(this.value != 0){			gBA.innerHTML = "<style>.c_count p:nth-child(" + this.value + ") {-webkit-column-break-after: " + show_ba_v_a + ";}</style><strong>第" + this.value + "行之后开始断开 -webkit-column-break-after: " + show_ba_v_a + "</strong>";		}else{			gBA.innerHTML = "";		}	}		var cS = document.getElementById("column_span");	var gS = document.getElementById("get_span");	var show_S_v = "auto";	var show_S_v_a = "all";	cS.onchange = function() {		if(this.value != 0){			gS.innerHTML = "<style>.c_count p:nth-child(" + this.value + ") {-webkit-column-span: " + show_S_v_a + ";padding:10px;background-color:rgb(250, 252, 212);}</style><strong>第" + this.value + "行通栏显示 -webkit-column-span: " + show_S_v_a + "</strong>";		}else{			gS.innerHTML = "";		}	}}</script><div>栏数:<input type="range" step="1" min="1" max="10" value="3" id="column_num" /><span id="get_count"></span></div><ul id="control">	<li>分栏之间的间隔:<input type="text" value="" placeholder="数值和单位如:2em" id="column_gap" /><span id="get_gap"></span></li>	<li>分栏之间的颜色值:<input type="color" id="column_rule_color" /></li>	<li>分栏之间的间隔线大小:<input type="text" value="" placeholder="数值和单位如:1px" id="column_rule_va" /></li>	<li>分栏之间的间隔线类型:		<select id="line_type">			<option value="" selected="selected">选择线条类型</option>			<option value="solid">solid</option>			<option value="dashed">dashed</option>		</select><span id="get_rule"></span>	</li>	<li>设置某个段落在分栏时通栏显示:<input type="range" step="1" min="0" max="13" value="1" id="column_span" /><span id="get_span"></span></li>	<li>设置某个段落在分栏时是否强制不断开,显示在一栏中:<input type="range" step="1" min="0" max="13" value="0" id="column_break_inside" /><span id="get_break_inside"></span></li>	<li>设置某个在某个段落前断开,从该段落开始在新的一栏中显示:<input type="range" step="1" min="0" max="13" value="0" id="column_break_before" /><span id="get_break_before"></span></li>	<li>设置某个在某个段落后断开,让后面的段落在新的一栏中显示:<input type="range" step="1" min="0" max="13" value="0" id="column_break_after" /><span id="get_break_after"></span></li></ul><div class="c_count">	<p><strong>第一行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第二行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第三行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第四行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第五行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第六行</strong> 第九届力支持,其宗旨是、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第七行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第八行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第九行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第十行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第十一行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第十二行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p>	<p><strong>第十三行</strong> 第九届联合国际计算机会议得到广东省科技厅网站、广东省信息产业厅、珠海市人民政府及当地学术界和实业界的大力支持,其宗旨是为IT专业人士提供一个交流最新研究成果,了解本领域最新技术发展趋势,探讨IT产业对全球化趋势日益明显的世界新经济影响与作用的舞台,以达到促进地区IT产业发展的目的。应邀参加此次大会的主讲嘉宾包括微软、英特尔、爱立信、三星电子、甲骨文、戴尔等国际知名公司的高层,以及国家科技部、信息产业部、中科院、清华大学、中山大学、国防科技大学、香港大学、联想研究院等部门的官员、专家和学者。</p></div></body></html>
Copy after login


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What functions does Doubao app have? What functions does Doubao app have? Mar 01, 2024 pm 10:04 PM

There will be many AI creation functions in the Doubao app, so what functions does the Doubao app have? Users can use this software to create paintings, chat with AI, generate articles for users, help everyone search for songs, etc. This function introduction of the Doubao app can tell you the specific operation method. The specific content is below, so take a look! What functions does the Doubao app have? Answer: You can draw, chat, write articles, and find songs. Function introduction: 1. Question query: You can use AI to find answers to questions faster, and you can ask any kind of questions. 2. Picture generation: AI can be used to create different pictures for everyone. You only need to tell everyone the general requirements. 3. AI chat: can create an AI that can chat for users,

The difference between vivox100s and x100: performance comparison and function analysis The difference between vivox100s and x100: performance comparison and function analysis Mar 23, 2024 pm 10:27 PM

Both vivox100s and x100 mobile phones are representative models in vivo's mobile phone product line. They respectively represent vivo's high-end technology level in different time periods. Therefore, the two mobile phones have certain differences in design, performance and functions. This article will conduct a detailed comparison between these two mobile phones in terms of performance comparison and function analysis to help consumers better choose the mobile phone that suits them. First, let’s look at the performance comparison between vivox100s and x100. vivox100s is equipped with the latest

Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Apr 09, 2024 pm 03:20 PM

Fermat's last theorem, about to be conquered by AI? And the most meaningful part of the whole thing is that Fermat’s Last Theorem, which AI is about to solve, is precisely to prove that AI is useless. Once upon a time, mathematics belonged to the realm of pure human intelligence; now, this territory is being deciphered and trampled by advanced algorithms. Image Fermat's Last Theorem is a "notorious" puzzle that has puzzled mathematicians for centuries. It was proven in 1993, and now mathematicians have a big plan: to recreate the proof using computers. They hope that any logical errors in this version of the proof can be checked by a computer. Project address: https://github.com/riccardobrasca/flt

What is Discuz? Definition and function introduction of Discuz What is Discuz? Definition and function introduction of Discuz Mar 03, 2024 am 10:33 AM

"Exploring Discuz: Definition, Functions and Code Examples" With the rapid development of the Internet, community forums have become an important platform for people to obtain information and exchange opinions. Among the many community forum systems, Discuz, as a well-known open source forum software in China, is favored by the majority of website developers and administrators. So, what is Discuz? What functions does it have, and how can it help our website? This article will introduce Discuz in detail and attach specific code examples to help readers learn more about it.

What exactly is self-media? What are its main features and functions? What exactly is self-media? What are its main features and functions? Mar 21, 2024 pm 08:21 PM

With the rapid development of the Internet, the concept of self-media has become deeply rooted in people's hearts. So, what exactly is self-media? What are its main features and functions? Next, we will explore these issues one by one. 1. What exactly is self-media? We-media, as the name suggests, means you are the media. It refers to an information carrier through which individuals or teams can independently create, edit, publish and disseminate content through the Internet platform. Different from traditional media, such as newspapers, television, radio, etc., self-media is more interactive and personalized, allowing everyone to become a producer and disseminator of information. 2. What are the main features and functions of self-media? 1. Low threshold: The rise of self-media has lowered the threshold for entering the media industry. Cumbersome equipment and professional teams are no longer needed.

PHP Tips: Quickly Implement Return to Previous Page Function PHP Tips: Quickly Implement Return to Previous Page Function Mar 09, 2024 am 08:21 AM

PHP Tips: Quickly implement the function of returning to the previous page. In web development, we often encounter the need to implement the function of returning to the previous page. Such operations can improve the user experience and make it easier for users to navigate between web pages. In PHP, we can achieve this function through some simple code. This article will introduce how to quickly implement the function of returning to the previous page and provide specific PHP code examples. In PHP, we can use $_SERVER['HTTP_REFERER'] to get the URL of the previous page

What are the functions of Xiaohongshu account management software? How to operate a Xiaohongshu account? What are the functions of Xiaohongshu account management software? How to operate a Xiaohongshu account? Mar 21, 2024 pm 04:16 PM

As Xiaohongshu becomes popular among young people, more and more people are beginning to use this platform to share various aspects of their experiences and life insights. How to effectively manage multiple Xiaohongshu accounts has become a key issue. In this article, we will discuss some of the features of Xiaohongshu account management software and explore how to better manage your Xiaohongshu account. As social media grows, many people find themselves needing to manage multiple social accounts. This is also a challenge for Xiaohongshu users. Some Xiaohongshu account management software can help users manage multiple accounts more easily, including automatic content publishing, scheduled publishing, data analysis and other functions. Through these tools, users can manage their accounts more efficiently and increase their account exposure and attention. In addition, Xiaohongshu account management software has

How to use Microsoft Reader Coach with Immersive Reader How to use Microsoft Reader Coach with Immersive Reader Mar 09, 2024 am 09:34 AM

In this article, we will show you how to use Microsoft Reading Coach in Immersive Reader on Windows PC. Reading guidance features help students or individuals practice reading and develop their literacy skills. You start by reading a passage or a document in a supported application, and based on this, your reading report is generated by the Reading Coach tool. The reading report shows your reading accuracy, the time it took you to read, the number of words correct per minute, and the words you found most challenging while reading. You will also be able to practice the words, which will help develop your reading skills in general. Currently, only Office or Microsoft365 (including OneNote for Web and Word for We

See all articles