I am working on a site with has responsive design i am facing rendering issue with forms fields on different devices & browsers.
for Firefox on phone and Tab (Android) It renders form fields differently either they come with rounded edges or gradient style.
How can i make them look same like simple rectangle with border.
CSS with i had applied is
input
{
box-sizing: border-box;
-moz-user-input:none;
-moz-user-select:none;
border: 1px solid #ccc;
font-size: 12px;
height: 30px;
line-height:30px;
vertical-align:middle;
padding-left: 5px;
color:#687074;
}
select {
border: 1px solid #ccc;
font-size: 13px;
height: 36px;
line-height:36px;
vertical-align:middle;
padding-left: 5px;
color:#687074;
}
I tried could of open but it still come differently.
I have setup example on jsfiddle Frame only Editable version
These form fields come with show or gradient inside fields. How can i remove all that and make it like simple with with border of 1px
Try adding:
input:focus, select:focus {
outline: none;
}
input, select{
-webkit-appearance: none;
border-radius:0;
background-image: none;
background-color:transparent;
}
Related
I have created a Watu quiz however the labels are not aligning with the radio buttons. How would I style this and align??
Page here - https://training.thermochamp.com.au/203-2/
Here is a screenshot:
In your style.css, add following:
.quiz-form input[type="checkbox"],
.quiz-form input[type="radio"] {
vertical-align: -1.2em !important;
}
/* style more */
.question-content ~ div {
border-left: 4px solid #666;
background-color: #ddd;
padding-left: 8px;
margin-bottom: 12px;
border-radius: 4px;
}
See this fiddle: https://jsfiddle.net/tqhf0p3m/1/
I couldn't attach the fonts, but you can more or less get some ideas from it.
For some reason I can't style submit form buttons the way I want.
Here's how they look right now.
This code works for normal buttons but not on form submit buttons.
#sprint1, #sprint2, #sprint3, #sprint4, #sprint5 {
width: 13%;
height: 40px;
display: inline-block;
vertical-align: top;
font-family: Verdana, "Helvetica", sans-serif;
font-size:small;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
text-align: center;
text-shadow: 1px 1px 0px #07526e;
padding-top: 2px;
margin-left: auto;
margin-right: auto;
left: 16%;
margin-top: 2%;
position: relative;
cursor: pointer;
border: none;
background-color: #467;
border-radius: 5px;
}
As you can see the gray textboxes look hideous over the blue backgrounds.
I simply cannot go for button tags, which I have no trouble styling at all. But I have to stick with form submit buttons because they trigger a PHP function that I can't get normal buttons to do.
How do I rid these gray boxes and have the text over the blue buttons instead? Thanks very much!
Here's my fiddle
input[type=submit] {
background-color:transparent;
border:none;
}
This is how you apply styling to inputs. In your fiddle, you only applied styles to the <form>
edit
My example above makes the button transparent. My actual advice would be to apply the form's styling to the input to make the input blue without border, etc.
Because it is just 1px I can't tell if it is the text box next to the button or the button itself. So I was going to take a screenshot and look at it with a measuring tool. From there I was going to look the firefox debugger and ie debugger to see what is off by 1px.
However I was hoping someone might have an idea to what is causing this.
Here is the offending element in ie ( 28 px )
Here is where it is correctly displayed in FF, Chrome, etc. ( 27 px )
http://www.arcmarks.com
Here is the CSS for the button:
#ue_but_new{
position: absolute;
padding: 8px 6px 7px 6px;
text-decoration: none;
cursor: pointer;
}
p.small_white{
font-size: 10px;
color: #ffffff;
}
.blue_but{
color: #ffffff;
border: 1px solid #057ed0;
background: -moz-linear-gradient(top, #31baed, #019ad2);
}
If you base element size on text size, it will always vary between different browsers, different systems, different settings, et.c.
Set a specific line height on the element instead of padding from the text height:
#ue_but_new{
position: absolute;
line-height: 25px;
padding: 0 6px;
text-decoration: none;
cursor: pointer;
}
You could try to apply border on the input & button wrapper, then set overflow:hidden.
This way, even if it's off by a pixel, it's not visible.
In HTML:
<div>
<input type="" />
<button></button>
</div>
In CSS (roughly):
div {
border:1px solid #ccc;
border-radius:3px;
background:#fff;
overflow:hidden;
}
input {
border:0;
background:transparent;
}
button {
background:blue;
}
div, input, button { height:22px; }
Prefer setting the line-height property to vertically center a single line of text rather than using padding-bottom and padding-top.
In your case font-size: 10px + padding-top: 8px + padding-bottom: 7px = line-height: 25px.
#ue_but_new {
position: absolute;
padding: 0 6px;
line-height: 25px;
text-decoration: none;
cursor: pointer;
}
I have this issue with <input type="text">where I see some extra border in top and left of the input box.
I have this CSS code -
#add{
width: 60%;
height: 25px;
margin: 0 auto;
border: auto;
border-radius: 10px;
}
I am attaching the screenshot from chrome. Firefox shows the same thing.
Try
#add{
width: 60%;
height: 25px;
margin: 0 auto;
border: none; /* <-- This thing here */
border:solid 1px #ccc;
border-radius: 10px;
}
By setting it to border:none the default css of the text field will be gone and your ready to style it for yourself.
Demo
#add {
width: 60%;
height: 25px;
margin: 0 auto;
border: 1px solid black;
border-radius: 10px;
}
Border auto is doing that for you. So have your own defined border style.
I noticed in Chrome that the user agent style that causes this specific look is border-style: inset; You can see it in the snippet below. Chrome is handy about indicating the user agent styles. I found two ways to fix this appearance.
Simply set border: 1px solid black; and you notice that the border will lose that inset look.
If you want extra caution, you can set border-style: none; This will cause the border to disappear altogether. You can then set the border as you wish.
I would test any of these solutions across different browsers.
Chrome User Agent Stylesheet:
input {
-webkit-appearance: textfield;
background-color: white;
-webkit-rtl-ordering: logical;
cursor: text;
padding: 1px;
border-width: 2px;
border-style: inset; /* This rule adds the inset border */
border-color: initial;
border-image: initial;
}
By setting the border: none; will override/nullify the default input css of the text field and then you can add your own custom css to beautify the input text element like so:
border: none; /*removes the default css*/
border: 1px solid black; /*your custom css*/
border-radius: 10px; /*your-border radius*/
However the above method is unnecessarily tedious whereas you could achieve the same result in just a single line with:
border-radius: 10px !important; /*this simply does the trick!!!*/
**Note:** The !important property in CSS is used to provide more weight (importance)
than normal property. It means that “this is important”, ignore all the subsequent
rules
<input type="text" style="border-radius: 25px;" /> 100% works
Try this thing
I'm currently at a loss concerning this issue. What I'm making is a WYSIWYG editor (much like the one I am using right now) and the problem is the buttons on top. I have made a CSS class of their layout:
.test {
background-color:#d0d0d0;
color:#000000;
font-family:arial;
font-size:12px;
font-weight:bold;
padding:2px 7px;
text-decoration: none;
}
.test:hover {
padding: 1px 6px;
background-color:#789dfa;
border: 1px solid #485ae0;
}
The layout works fine but I am unable to find a proper way to link the class. Take this for example(ignore the JavaScript):
<input type="submit" class="test" value="B" onClick="texta(text,'b','b')" onmouseup="text.focus();">
Problem is that any buttons (<button>, <type="submit> etc) tend to deform the original design, giving it 3-dimensional look and generally making it look more like a button.
My question is, how do I work around this? I've tried to link the class in several different ways but it just won't work.
Picture:
I usually go with:
html:
<div class="test"><a data-js="texta(text,'b','b')" href="http://someOtherLikeActionIfTheresNoJs"></a></div>
css:
.test {
[ ... snipped your style ... ]
position: relative;
}
.test a {
display: block;
height: 100%;
width: 100%;
position: absolute;
top: 0px;
left: 0px;
}
Tweaked your css just a bit
.test{
background-color:#d0d0d0;
border: 1px solid #f5f5f5; //<--add this
color:#000000;
font-family:arial;
font-size:12px;
font-weight:bold;
padding:2px 7px;
text-decoration: none;
}
.test:hover {
padding: 1px 6px;
background-color:#789dfa;
border: 1px solid #485ae0;
}
Works on input or button elements
Here's a FIDDLE with the result.