I am trying to work out how I get a navigation menu next to my blog content.
I don't want the navigation menu header - the button that makes the menu slide out. I want the menu to show inside a card.
Here is what I have so far, but it is not material:
HTML
<ul class="card_nav">
<li> <a>test</a></li>
</ul>
CSS
.card_nav {
list-style: none;
width: auto;
height: auto;
margin: 8px auto;
border-radius: 0;
background-color: #FFF;
/*box-shadow: 0px 20px 70px 0px rgba(0, 0, 0, 0.21);*/
position: relative;
overflow: hidden;
}
For show the rules of material design you can see here
Create a visual language that synthesizes classic principles of good design with the innovation and possibility of technology and science.
For this you can use text, border or other way that must choose you.
Develop a single underlying system that allows for a unified experience across platforms and device sizes. Mobile precepts are fundamental, but touch, voice, mouse, and keyboard are all first-class input methods.
For you can use media queries, flexbox, semantic tag like `, , ` etc. and also `attr abbr` for screen reader.
So, I advice you of use shadow for your box, border-radius and other effects similar.
I've tried to do an easy code in material style based on your code:
.card_nav {
list-style: none;
width: 100px;
height: 400px;
margin: 8px auto;
border-radius: 0;
background-color: #FFF;
/*box-shadow: 0px 20px 70px 0px rgba(0, 0, 0, 0.21);*/
position: relative;
overflow: hidden;
-webkit-box-shadow: 1px 1px 3px 2px #eee;
-moz-box-shadow:1px 1px 3px 2px #eee ;
box-shadow: 1px 1px 3px 2px #eee;
padding: 10px 20px;
}
ul.card_nav li a {
text-transform: uppercase;
text-align: center;
}
ul.card_nav li a:hover {
border-bottom: 2px solid #ff0000;
}
<ul class="card_nav">
<li> <a>test</a></li>
</ul>
Related
we are developing hybrid mobile application using dojo 1.10.3 .
all devices text field is coming UI is good except iPhone environment text field inside top portion unwanted property(black color border and shadow) coming that is not looking good.
In that input field we are not able to find it what is that exactly property
we are taking some input fields and adding css properties like below
.textbox{
margin: 0px auto 0px auto;
font-size: 12px;
font-weight: bold;
text-indent: 10px;
color: rgba(23, 82, 117, 1.0);
display: block;
width: 85%;
height: 34px;
border: 1px solid rgba(204, 204, 204, 1.0);
border-radius: 0px;
background-color: white !important;
outline: none !important;
-webkit-box-shadow: inset 0px 0px 0px 0px transparent;
-moz-box-shadow: inset 0px 0px 0px 0px transparent;
box-shadow: inset 0px 0px 0px 0px transparent;
}
<input data-dojo-type="dojox.mobile.TextBox" class="textbox">
<input data-dojo-type="dojox.mobile.TextBox" class="textbox">
<input data-dojo-type="dojox.mobile.TextBox" class="textbox">
and textfeild default css code in iphone.css like below
.mblTextBox {
height: 22px;
border-width: 1px;
border-style: inset;
font-family: Helvetica;
font-size: 13px;
border-color: #9cacc0;
border-radius: 5px;
}
i am attaching screen shots Please find my problem easily understand
we want like this
enter image description here
actual problem below like this
enter image description here
Try adding: -webkit-appearance: none; to all input elements in CSS.
The input below should appear the same on all browsers (including mobile Safari)
input[type=text] {
-webkit-appearance: none;
border: 1px solid black;
border-radius: 0px;
outline: none;
width: 200px;
margin: 0px;
padding: 4px;
}
<input type="text" />
Edit:
It seems that you're problem could also be solved via this way: https://davidwalsh.name/input-shadows-ipad
Edit 2:
I've tried the example below multiple times and it should definitely work. If not, you're using some CSS rules that might override one (or more) of the rules from the example.
Result on iPhone Simulator:
ul.examples {
list-style: none;
padding: 0px;
font-family: Arial;
}
.textbox {
margin: 5px 0px 10px 0px;
display: block;
width: 100%;
border: 1px solid rgba(204, 204, 204, 1.0);
border-radius: 0px;
outline: none !important;
}
.example:last-child .textbox {
-webkit-appearance: none;
color: red;
}
<ul class="examples">
<li class="example">Your example:
<br/>
<input data-dojo-type="dojox.mobile.TextBox" class="textbox">
</li>
<li class="example">My example:
<br/>
<input data-dojo-type="dojox.mobile.TextBox" class="textbox">
</li>
</ul>
The problem is, that I have table for content with 3 td's, side td is 200px wide and the middle one width isn't defined, everything seems great on computer browsers (even internet explorer), but when it comes to testing on windows phone browser, in middle td text is much bigger, I'd would say twice as big as it should be and nothing seems to fix that, yes I tried writing font-size value to it in css, but that didn't seem to make any difference.
Sorry that I can't supply a screenshot from my windows phone because of broken power button, I'm using standard windows phone 8.1 internet explorer.
CSS of the table
#content_table {
width: 1024px;
border-spacing: 0;
margin-bottom: 30px;
border-collapse: collapse;
table-layout: fixed;
}
#content_table td:not(:last-child) {
padding: 0 15px 0 0;
}
#content_table #side_content {
width: 200px;
vertical-align:top;
}
#content_table #main_content {
width: 100%;
vertical-align:top;
font-size: 16px;
}
.side_content_title {
background: #c9cbce;
border-top: solid 2px #535f7c;
border-bottom: solid 2px #535f7c;
text-align:center;
width: 200px;
color: #353c4c;
padding: 2px 0;
}
.side_content {
background: rgba(243,243,243,1);
-moz-box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
width: 190px;
padding: 5px;
border-bottom: solid 2px #535f7c;
color: #535f7c;
}
.main_content_title {
background: #c9cbce;
border-top: solid 2px #535f7c;
border-bottom: solid 2px #535f7c;
padding: 2px 0 2px 30px;
color: #353c4c;
}
.main_content {
background: rgba(243,243,243,1);
-moz-box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
padding: 5px;
border-bottom: solid 2px #535f7c;
color: #535f7c;
}
HTML part
<table id="content_table">
<tbody>
<tr>
<td id="side_content">
<div class="side_content_title">title</div>
<div class="side_content"><br/><br/></div>
</td>
<td id="main_content">
<div class="main_content_title">title</div>
<div class="main_content">
Lorem ipsum<br/><br/>
</div>
</td>
<td id="side_content">
<div class="side_content_title">title</div>
<div class="side_content"><br/><br/></div>
</td>
</tr>
</tbody>
</table>
Thanks Mousey for helping, and pointing out to previously answered question. Setting view-port for device width could help if I wouldn't used few fixed position objects, but adding
-ms-text-size-adjust: none;
to body fixed text-size problem without messing up with anything else.
Use belo code in the body tag or to the main table
-ms-text-size-adjust: none;
Removing the line font-size: 16px; from this code should render will all <td> using the same font size
#content_table #main_content {
width: 100%;
vertical-align:top;
}
I think you are finding the phone automatically shrinks the font on smaller devices - except when it is manually specified in the code. 16px will look large on a mobile.
Setting the view-port may also help - see HTML CSS - Font size oversized when shown on windows phone for font-size issues on windows phone
Edit from the link above, using this fixed the problem as EDWcode stated.
-ms-text-size-adjust: none;
I'm making a web page (lots of them that are connected)
I have added the glow function/attribute to my buttons in CSS. The thing is I've used this;
button:hover {
border: 80px solid #ffffff;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: 0px 0px 4px #ffffff;
-moz-box-shadow: 0px 0px 4px #ffffff;
box-shadow: 0px 0px 4px #ffffff;
}
The thing is, my CSS file is linked and being used by 5 different HTML files and more are coming. So instead of just getting the glow effect on just 4-5 buttons that I have on one HTML page, the glow function now is on all buttons on all other HTML pages.
How do I avoid this, I cant add the glow function inside the #id's can I?
My buttons like like this in css
#TrafficJam1 {
position: absolute;
top: 1120px;
left: 20px;
height:107px;
width: 278px;
}
That's just one of them
Here's the HTML part of that particular one,
<input type="image" src="TrafficJam.jpg" id="TrafficJam1">
I have to use this code because my buttons are images.
Give the buttons you want to apply this CSS to a class like this:
<input type="image" src="TrafficJam.jpg" id="TrafficJam1" class="glow">
A class is another identifier for html elements. But it's different from id in the sense that you may use them to target multiple elements at a time. So you can just give the buttons you want this effect on the same class and target that class in your CSS like this:
.glow:hover {
border: 80px solid #ffffff;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: 0px 0px 4px #ffffff;
-moz-box-shadow: 0px 0px 4px #ffffff;
box-shadow: 0px 0px 4px #ffffff;
}
Then a little bit off topic. The thing you're asking is pretty basic stuff. So I get it that you're beginner at HTML and CSS, right? In case you are it would be wise to learn some more HTML and CSS with an online learning tool like codecademy.com.
Create a new stylesheet and link this in the page where you want the buttons to glow.
This is easily done by using the <link> tag, but I guess you are familiar with that.
In that file you could just add the code you were using:
.classname:hover {
border: 80px solid #ffffff;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: 0px 0px 4px #ffffff;
-moz-box-shadow: 0px 0px 4px #ffffff;
box-shadow: 0px 0px 4px #ffffff;
}
I have a navigation bar but want to add images to it, so that rather than text links, the nav bar is made up of buttons consisting of an image and text which have a hover effect etc.
But as some of the link names are dynamic I can't make the buttons in photoshop so was wondering how to make this type of nav bar in just html and css.
Any ideas?
EDIT
To clarify i have the following image sample nav button
and want to add text beneath this to form the buttons on the nav bar if that makes it clearer.
You can do a lot just with CSS
The basic idea is to change attributes of each state of the button using pseudo classes .cssclass:hover to mouse over state and .cssclass:active to mouse down.
normal
/* style of the button in normal state */
button.css3button{
padding: 0.5em;
background-color: lightblue;
border: 4px outset green;
color: green;
border-radius: 4px;
}
:hover
/* properties that change when mouse over */
button.css3button:hover {
background-color: lightgreen;
}
:active
/* properties that change when mouse down */
button.css3button:active {
color: yellow;
border: 4px inset red;
}
Live Demo: JSFIDDLE
more complex styling examples with CSS3:
<button type="button" name="" value="" class="css3button">submit</button>
button.css3button {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #ffffff;
padding: 10px 20px;
background: -moz-linear-gradient(
top,
#bfc2ff 0%,
#82b4ff 25%,
#4664fa);
background: -webkit-gradient(
linear, left top, left bottom,
from(#bfc2ff),
color-stop(0.25, #82b4ff),
to(#4664fa));
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
border: 3px solid #ffffff;
-moz-box-shadow:
0px 3px 11px rgba(000,000,000,0.5),
inset 0px 0px 1px rgba(49,141,212,1);
-webkit-box-shadow:
0px 3px 11px rgba(000,000,000,0.5),
inset 0px 0px 1px rgba(49,141,212,1);
box-shadow:
0px 3px 11px rgba(000,000,000,0.5),
inset 0px 0px 1px rgba(49,141,212,1);
text-shadow:
0px -1px 0px rgba(000,000,000,0.2),
0px 1px 0px rgba(255,255,255,0.3);
}
Demo: JSFIDDLE
you can of course change sizes, colors, gradients for each state :hover :active :visited on your own taste, you can style almost anything <a> <span> <div> <button>
This question isn't really suited for this forum. It is for specific problems, not basic tutorials. There are plenty of good tutorials out there you can find by doing a simple google search that walk you through basic CSS and how to achieve this.
But just to get you started, you could do something like this: http://jsfiddle.net/wgBTZ/
HTML:
<ul>
<li><a href="#" >One</a></li>
<li><a href="#" >Two</a></li>
<li><a href="#" >Three</a></li>
<li><a href="#" >Four</a></li>
</ul>
CSS:
li {
float:left;
width: 100px;
height: 40px;
background:#CCC;
margin:0 0 0 15px;
}
a {
color: black;
text-decoration:none;
float:left;
width: 100px;
height: 40px;
background:#CCC;
}
a:hover {
background:#000;
color:white
}
Edit: This is just the basic mechanics. With CSS3 you can take what I've done above and actually build some pretty cool stuff.
I am trying to do some CSS to complement my HTML code. I am effectively trying to make a little box which changes size based on the amount of text there is. Currently, this is what it looks like in action.
Essentially, I'd like it to form a little box around the text. Notice the last 'box' in the image, if the string is too long, it cuts it off and continues on the next line.
Included is the CSS code and an example of usage.
<style type="text/css">
boxytest
{
padding: 10px;
text-align: center;
line-height: 400%%;
background-color: #fff;
border: 5px solid #666;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-box-shadow: 2px 2px 4px #888;
-moz-box-shadow: 2px 2px 4px #888;
box-shadow: 2px 2px 4px #888;
}
</style>
<body>
<div align="center">
<boxytest> Hey guys! What's up? </boxytest>
</div>
</body>
Any help is greatly appreciated.
As chipcullen says inventing your own element is probably not the best way to go about this. But to answer your question the key style decleration your missing appears to be display:inline-block;
jsfiddle here
Well, I think first off, in terms of markup, you want to make boxytest a class, and not create a new element. And don't use 'align=center'. It's a pain to maintain.
I would do something like this:
<body>
<p class="boxy">Test sentence</p>
<body>
The in CSS:
.boxy {
padding: 10px;
text-align: center;
line-height: 400%%;
background-color: #fff;
border: 5px solid #666;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-box-shadow: 2px 2px 4px #888;
-moz-box-shadow: 2px 2px 4px #888;
box-shadow: 2px 2px 4px #888;
/* to prevent word wrapping */
white-space: nowrap;
overflow: hidden;
}
The last bit is based on this post.