css

How to make text bold,italic and underline using jquery

ぐ巨炮叔叔 提交于 2021-02-17 15:22:27
问题 I have three checkboxes and a textbox now If I write something in textbox and check the bold checkbox the text should appear with bold effect and similarly italic and underline without postback(i.e it should reflect immediately with the selected effect). Here is my code: Bold:<input type="checkbox" value=""/> Italic:<input type="checkbox" value=""/> Underline:<input type="checkbox" value=""/> <input type="text" value=""> 回答1: You can do the following: <form> Bold:<input name="textStyle" type=

Change SVG Viewbox size with CSS

梦想与她 提交于 2021-02-17 14:28:13
问题 The Question: Is there a way to change the size of the SVG viewbox with CSS, but preserve the aspect ratio? OR is there another way to preserve the aspect ratio of the SVG without a view box. The Problem: I want to responsively adjust the size of the SVG, but keep the aspect ratio. The width of the viewbox adjusts with the page, but the height doesn't adjust with the width. The problem with that is that the height of the container div is dependent on the height of the viewbox. So the

Creating a 16x16 grid using JavaScript

て烟熏妆下的殇ゞ 提交于 2021-02-17 12:45:37
问题 I'm trying to create a 16x16 grid in JavaScript. The method I'm trying to use is to create an empty div in HTML, and then append other divs to it, and outline their borders. I can't seem to make this work, and I've put my code below. HTML: <!DOCTYPE html> <head> <title>Etch-a-Sketch</title> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="app.js"></script> </head> <body> <div id="container"> </div> </body> JavaScript: // Sets important constants and

Creating a 16x16 grid using JavaScript

对着背影说爱祢 提交于 2021-02-17 12:43:11
问题 I'm trying to create a 16x16 grid in JavaScript. The method I'm trying to use is to create an empty div in HTML, and then append other divs to it, and outline their borders. I can't seem to make this work, and I've put my code below. HTML: <!DOCTYPE html> <head> <title>Etch-a-Sketch</title> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="app.js"></script> </head> <body> <div id="container"> </div> </body> JavaScript: // Sets important constants and

Creating a 16x16 grid using JavaScript

六眼飞鱼酱① 提交于 2021-02-17 12:42:58
问题 I'm trying to create a 16x16 grid in JavaScript. The method I'm trying to use is to create an empty div in HTML, and then append other divs to it, and outline their borders. I can't seem to make this work, and I've put my code below. HTML: <!DOCTYPE html> <head> <title>Etch-a-Sketch</title> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="app.js"></script> </head> <body> <div id="container"> </div> </body> JavaScript: // Sets important constants and

Does bootstrap 4 have a built in horizontal divider?

倖福魔咒の 提交于 2021-02-17 08:21:26
问题 Does bootstrap 4 have a built in horizontal divider? I can do this, <style type="text/css"> .h-divider{ margin-top:5px; margin-bottom:5px; height:1px; width:100%; border-top:1px solid gray; } </style> But I want to use the built in bootstrap css, I can't find it anywhere in the docs, maybe I'm missing it. 回答1: HTML already has a built-in horizontal divider called <hr/> (short for "horizontal rule"). Bootstrap styles it like this: hr { margin-top: 1rem; margin-bottom: 1rem; border: 0; border

How to horizontally center an element

↘锁芯ラ 提交于 2021-02-17 06:43:28
问题 How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <div id="inner">Foo foo</div> </div> 回答1: You can apply this CSS to the inner <div> : #inner { width: 50%; margin: 0 auto; } Of course, you don't have to set the width to 50% . Any width less than the containing <div> will work. The margin: 0 auto is what does the actual centering. If you are targeting Internet Explorer 8 (and later), it might be better to have this instead: #inner { display: table; margin:

CSS3 gradient 颜色渐变效果

£可爱£侵袭症+ 提交于 2021-02-17 06:41:25
CSS3 Gradient分为 linear-gradient(线性渐变) 和 radial-gradient(径向渐变) 。为了更好的应用CSS3 Gradient, 需要先了解一下目前的几种浏览器的内核,主要有Mozilla( Friefox, Flock等), webkit(Safari, chrome等),Opera(Opera浏览器), Trident(IE浏览器)。 线性渐变在Mozilla下的应用: 语法: -moz-linear-gradient( [<point> || <angle>,]? <stop>, <stop> [, <stop>]* ) 参数:其共有三个参数,第一个参数表示线性渐变的方向,top是从上到下,left是从做到右,如果定义成left top,那就是从左上角到右下角。第二个和第三个参数分别是起点颜色和终点颜色。你还可以在它们之间插入更多的参数,表示多种颜色的渐变。如图所示: 根据上面的介绍,我们先来看看一个简单的例子: HTML: <div class="example example1"></div> CSS: .example { width: 150px; height: 80px; } 如无特殊说明,我们后面的实例都是应用这一段html和CSS的基本代码。 现在我们给这个div应用一个简单的渐变样式: .example {

Getting two buttons next to each other

╄→гoц情女王★ 提交于 2021-02-17 06:40:09
问题 I am having a problem with my design. I have two buttons on my product page. However because one is in a form, they are on top of each other(see image ). I want to get the two buttons next to each other. Can someone help me out, please ? Below I added my HTML and CSS code. Thanks in advance! HTML: <!DOCTYPE HTML> <div class="container text-center"> <div class="sale"> <h1>On Sale</h1> <p class="text-secondary"> We have new sales promotions online for a short period of time every day. We offer

include part of a website in my website

坚强是说给别人听的谎言 提交于 2021-02-17 06:39:11
问题 I am trying to find a way to include part of another website in my website. can i do this - im thinking may use an iframe but how can i make it only show say one on the other site. for example, if the other site has: <div id="a_div"> content here </div> <div id="b_div"> other content here </div> how can i include only the *a_div* div on my site so only: content here will display? 回答1: You can't do what you're trying to do, sorry, It's not possible to filter the iframe content. 回答2: You can't,