css3

How to animate gradient background smoothly

泪湿孤枕 提交于 2019-12-31 07:43:12
问题 I want to achieve an effect than when the user hovers over a div, it's background color turns into a gradient that smoothly switches from one corner to the other, repeatedly, using purely CSS. The effect I want to achieve, trying to put it more into words, is that the darker part of the background (the one with 0.9 opacity) slides from one corner to the other repeatedly as long as the cursor remains above the element. What is actually happening is that the background jumps from one state to

jquery code works on codepen/jsfiddle but not html page

拈花ヽ惹草 提交于 2019-12-31 06:52:09
问题 My code for collapsible jquery div works on codepen and JSFiddle, but when I copy everything to my page (content adapted), the div does not expand. What am I missing, or where did I go wrong? My script tags in the head are as follows: <head> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script> <script type="text/javascript"> $(".header").click(function () { $header = $(this); $content = $header.next(); $content.slideToggle

How to prevent a TextArea that resizes from overflowing the page?

亡梦爱人 提交于 2019-12-31 06:30:47
问题 I'm working to create a TextArea that is horizontally and vertically centered in the page. Given that I need the TextArea to be vertically centered, I can't have the textarea be 100w and 100h, I need it to start with a small height and then grow as the user types. I also need a click capturer so if the user clicks the area surrounding the textarea, the textarea focuses. (the gray bkg is just for debugging purposes) I have a demo on CodePen here: https://codepen.io/anon/pen/OQbvxa autosize

Is it possible to use position relative more than once in the same html page?

我怕爱的太早我们不能终老 提交于 2019-12-31 05:57:07
问题 I am using 'position relative' and 'position absolute' on my master page. I have a page that use the above master page, And I am trying to use in this page the 'Position relative' and 'position absolute' again for 2 other elements, but the element below ('position absolute') in this page is not placed according to the element above his ('position relative') and instead it refers to the 'position relative' of the element in the master page.. Hope is was not too clumsy explanation.. Is it

CSS Centering a div in different Screens

强颜欢笑 提交于 2019-12-31 05:46:10
问题 I am wondering if the div in this css and html will stay at the center if I i view this site on a larger screen. since I am only working on a 16 inch screen/ monitor. will the div in this code will stay at the center even if I move or view it in a larger/different screen? ? The Html <html> <head> <title>Midterm Practice</title> <link rel = "stylesheet" type = "text/css" href = "layout.css"/> </head> <body> <div id = "container"> <div id = "navbar"> <ul> </ul> </div> </div> </body> </html> The

Firefox Placeholder Before CSS selector not working

社会主义新天地 提交于 2019-12-31 05:26:13
问题 I'm using the latest firefox 30.0. I'm trying to insert a red font awesome star before the placeholder of required fields. I got this working in Chrome no problem but I'm having issues with FF and. Here's a codepen illustrating my issue - http://codepen.io/anon/pen/BLibw My markup: <input placeholder="Address" data-required required id="id_street" name="street" type="text" /> My CSS(sass): [data-required] { &::-webkit-input-placeholder::before { font-family: fontAwesome; content:'\f005 ';

Create vertically centered horizontal line to fill width of title with padding in CSS

你。 提交于 2019-12-31 05:25:26
问题 I basically need to create a title that has a vertically centered horizontal line filling up the width (left and right) but that also supports multiple text elements on the same line, e.g. to form something like: ----- Alpha - Beta - Gamma ----- This is what I have so far: JSfiddle Here, I have the demo working fine BUT it requires a background to work, this isn't a good solution since my background on my site is not a static single color (it's a fixed picture which doesn't move when you

How to change a single character color in textarea

十年热恋 提交于 2019-12-31 05:24:23
问题 Please i need to change color of a single character in textarea using JQuery. 回答1: You can't. A textarea is plain text only. That's why, for example, HTML inside a textarea is rendered literally (except for </textarea> ). 回答2: I changed the textarea by a content editable div: <div contenteditable="true"></div> div {width:98%;clear: both;font-size: 10pt;max-width:98%;height:250px;min-height:98%; left:10px;right:10px;background-color:#fff;border:1px solid #1c578d;bottom:10px;top:10px;color:

Keep CSS from refreshing on page reload

萝らか妹 提交于 2019-12-31 04:46:45
问题 I have a html page with two CSS files - one for a light theme and one for a dark theme. When I click the respective button, the theme changes to either light.css or dark.css. However, whenever I refresh the page, reload the page, go back etc. It changes back to the default css (being the light.css file). Is there any way I can get it to stay on the dark.css theme when I click the button and refresh the page? Thanks. 回答1: You can use a cookie, localStorage or sessionStorage where you keep the

Pure CSS Collapse Accordion

守給你的承諾、 提交于 2019-12-31 04:39:09
问题 I have a CSS collapse accordion with just pure CSS, it is working perfect. I have just 1 issue: right now if the user click in any label: Label One, Label Two, Label Three, he can't close it clicking in Label again, each label can just close if the user clicks in the next one I would like make it possible, example: the user click in Label One to open, if him click again this label will close and the same will all for all labels. js fiddle: https://jsfiddle.net/11wunqqz/4/ /* Acordeon styles *