html

CSS ID's and classes

寵の児 提交于 2021-02-05 04:54:30
问题 I'm new to HTML / CSS coding and since I first bumped into the ID and class selector, one question has been running through my mind. I searched the web thoroughly over and over again, but I coudln't find the answer I was looking for. The question is : Why use ID when you can do the same task with class ? I mean, ok I know that ID's are just for one time use and classes are for many, but what forbids me from using the class selector for just once ? So, according to this, what is the purpose of

CSS ID's and classes

余生长醉 提交于 2021-02-05 04:53:49
问题 I'm new to HTML / CSS coding and since I first bumped into the ID and class selector, one question has been running through my mind. I searched the web thoroughly over and over again, but I coudln't find the answer I was looking for. The question is : Why use ID when you can do the same task with class ? I mean, ok I know that ID's are just for one time use and classes are for many, but what forbids me from using the class selector for just once ? So, according to this, what is the purpose of

Change Position of svg element using JS

旧城冷巷雨未停 提交于 2021-02-05 04:52:17
问题 Trying to make an svg rectangle that moves when button pushed. Right now I just want the x to be modified by a function. function modX() { document.getElementById("rectangle").transform = 'translate(295 115)'; } var x = 20; var y = 20; modX(); <svg width="1000" height="1000" > <rect id="rectangle" x="0" y="20" width="100" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)"></rect> </svg> I'm fairly new to code so please avoid css or jquery. 回答1: you can change its x by

CSS position:fixed without top gives unexpected layout?

邮差的信 提交于 2021-02-05 04:51:37
问题 Given: <body> <div id="fixed"> Fixed div </div> <div id="nonfixed"> <p>Non-fixed div</p> <p>Non-fixed div</p> <p>Non-fixed div</p> </div> </body> And: * { box-sizing: border-box; } body { margin: 0; padding: 0; } #fixed { position: static; width: 100%; border: 3px solid #f00; } #nonfixed { margin-top: 50px; border: 3px solid #00f; } Note that position:static , this gives the expected result (fiddle): However, change position:static to fixed , and you get this (fiddle) Even though the #fixed

Change Position of svg element using JS

≡放荡痞女 提交于 2021-02-05 04:51:24
问题 Trying to make an svg rectangle that moves when button pushed. Right now I just want the x to be modified by a function. function modX() { document.getElementById("rectangle").transform = 'translate(295 115)'; } var x = 20; var y = 20; modX(); <svg width="1000" height="1000" > <rect id="rectangle" x="0" y="20" width="100" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)"></rect> </svg> I'm fairly new to code so please avoid css or jquery. 回答1: you can change its x by

CSS position:fixed without top gives unexpected layout?

邮差的信 提交于 2021-02-05 04:50:21
问题 Given: <body> <div id="fixed"> Fixed div </div> <div id="nonfixed"> <p>Non-fixed div</p> <p>Non-fixed div</p> <p>Non-fixed div</p> </div> </body> And: * { box-sizing: border-box; } body { margin: 0; padding: 0; } #fixed { position: static; width: 100%; border: 3px solid #f00; } #nonfixed { margin-top: 50px; border: 3px solid #00f; } Note that position:static , this gives the expected result (fiddle): However, change position:static to fixed , and you get this (fiddle) Even though the #fixed

Change color of an anchor when clicked

廉价感情. 提交于 2021-02-05 04:46:59
问题 i want that when i click this link its color changes to the given color <li id="press"><a href="<?=base_url()?>index.php/page/press">Press</a></li> 回答1: The CSS declaration :active will accomplish what you're after. http://www.w3schools.com/CSS/pr_pseudo_active.asp Example. a:active { color: #C00; } NB. a:active MUST come after a:hover in the CSS definition in order to be effective! 回答2: All links? a:focus { color: orange; } Some links? Give them a class, eg <a class="foo" ...> : a.foo:focus

increase font awesome icons

给你一囗甜甜゛ 提交于 2021-02-05 02:25:15
问题 I'm having a bit trouble with some font-awesome icons. I'm trying to increase the size of a few of them, but for some reason nothing I seem to do works. Here is my html <div class="span5 bookBuild"> <div class="well well-small"> <h4>Build your Book!</h4> <div class="span2"> <i class="icon-file icon-large"></i> </div><!--span2--> <div class="span9"> <p>This is a paragraph</p> </div><!--span9--> <p class="clearfix"></p> </div><!--well--> </div><!--span5--> and I have tried to add as you can see

increase font awesome icons

假装没事ソ 提交于 2021-02-05 02:24:30
问题 I'm having a bit trouble with some font-awesome icons. I'm trying to increase the size of a few of them, but for some reason nothing I seem to do works. Here is my html <div class="span5 bookBuild"> <div class="well well-small"> <h4>Build your Book!</h4> <div class="span2"> <i class="icon-file icon-large"></i> </div><!--span2--> <div class="span9"> <p>This is a paragraph</p> </div><!--span9--> <p class="clearfix"></p> </div><!--well--> </div><!--span5--> and I have tried to add as you can see

increase font awesome icons

邮差的信 提交于 2021-02-05 02:23:16
问题 I'm having a bit trouble with some font-awesome icons. I'm trying to increase the size of a few of them, but for some reason nothing I seem to do works. Here is my html <div class="span5 bookBuild"> <div class="well well-small"> <h4>Build your Book!</h4> <div class="span2"> <i class="icon-file icon-large"></i> </div><!--span2--> <div class="span9"> <p>This is a paragraph</p> </div><!--span9--> <p class="clearfix"></p> </div><!--well--> </div><!--span5--> and I have tried to add as you can see