CSS - How Do I Know The Shorthand Property Value Format?
Hi. How do I know the shorthand property value format?
For example: p { margin: 1em 2em 2em 1em; } How do I know which one is top, bottom, left, right? Can u do this as well? p { margin: 1em 2em; } What about other property do they always follow the same format and order? Any help will be great. Thanks. Similar TutorialsHello, I'm taking over management and development responsibilities from the developer who rebuilt our site. He did an awesome job and everything is well structured and clearly commented so I've had a pretty easy time getting around his code and making the tweaks I want. I need to make a simple CSS tweak but I'm unfamiliar with shorthand and need some help. The rule sets the style for paragraphs with the class "author_desc", i.e. Code: <p class="author_desc">This is some text</p> This is the CSS rule for the "author_desc" class: Code: #col_02 .feature_body p.author_desc { color: #a7a7a7; font-size: 1.3em; text-indent: 0; font-family: Arial, Verdana, sans-serif; font-style: italic; margin: 20px 0 0 0; padding: 0;} I need to add an additional rule that would render any italicized text in the paragraph as normal, i.e. Code: <p class="author_desc">This is my body text that is italicized, <i>but this is regular text</i>. Now we're back to italicized again.</p> How would I write the needed CSS for this? Thanks for your help! Hello, My font shorthand have this different outputs on IE and FF Quote: h1 { /*font-size: 16px; font-weight: bold; font-style: normal;*/ font: normal medium bold 16px Verdana, Arial, Helvetica, sans-serif; margin: 0 10px; padding: 15px 0 5px 0; color: #FFF; } If I replace the font-variant at shorthand it works well on IE but still the font size is not rendered Quote: font: normal larger bold 16px Verdana, Arial, Helvetica, sans-serif; the commented long hand is what I'm trying to get Here's the code:
Code: <html> <head> <title>Sample Font Shorthand</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body { margin: 0; behavior: url("../htcmime.php?file=csshover2.htc") } div { } table { width: 100% } .sttable { background-color: #000080 } tr { } td { vertical-align: top } .sttd { font: bold 12px Arial #FFFFFF } </style> </head> <body> <table class="sttable"> <tr> <td class="sttd">Catalog > Categories</td> <td class="sttd">Cart Total: $ 0.00</td> <td class="sttd">Date</td> </tr> </table> </body> </html> Would someone please tell me why the color of the text isn't rendering white? Is there such a thing as using an alt property for <img> tag? This would be awfully useful for SEO Will the -moz property ever become a valid CSS property. when I validate my CSS on w3.org I get errors. I remove all propertys that have a -moz in front of it and it is 100% valid. ALSO ... Is there a way to mask parts of the css from the validator or have a separate CSS file that can be masked from the validator to make it appear to be 100% valid.. Thanks My documentation for css shows that content: url(); works in navigator but not in ie. The info I've got is dated. Does the content property work in the newer ie browsers? Question: I have two class below. What I want is when I change the padding-top property value in div.content-full, I also want the padding-top property value in the div.content change to the same value div.content-full { float:left; width:100%; padding-top:10px; margin:0px; } div.content { float:left; width:70%; padding-top:06px; margin:0px; } Can anybody help me out? I'm trying to create some links that swap background images when you mouseover them. The non-CSS solution (which looks exactly how I want it to look) is located he http://84.9.221.75/domains/backingt...Musicindex.html My attempt at creating a CSS equivalent of those links is located on this page: http://84.9.221.75/domains/backingt...Musicindex.html I just need some help with the CSS I'm using on the latter page...I read up a little on how to do this, but it's obvious I'm still doing something wrong... I need the buttons and the text inside the buttons to line up and appear like they do in the first URL....can anyone give me some pointers here? Thank you. Hi all, I've got problm in css Listbox properties, I put list box within a normal html .. and there are 3 option to list like this.., 1.name 2.Address of a person 3.Phone no: resident so i give width=80px; in css and it will show the list box width correctly. but drop down part also the same width . so i want to expand the width as when we entered option text width. how can i achieve this ? pls help me......! Prachalitha This style is use useful or not @property-group title-style() { color: #004080; font-weight: bold; } @property-group standard-vmargins() { margin: 1.33ex 0; } title, subtitle, titleabbrev { display: block; property-group: title-style(); property-group: standard-vmargins(); } This is not support IE... I am wondering if there is some way to make a <div> layer automatically expand to the full height of the screen similar to the way that one would use width=100% when talking about the width of a page. I have a layer that I want to extend to the bottom of the page no matter what resolution the user has on their screen. Maybe the layer could just extend all the way until the next layer? Any Ideas? Thanks Jamie Hi, i am very new to css and I am confused about the difference between margin-top vs top please help Regards Ltoso Ok what i want to happen is that when person clicks on a link i want a div to appear/be visible underneath that link. But i want that div to not take any space unless i click on a link. I recently did something similar BUT the div was taking the space but was just hidden. I am trying to figure out how I can get this red curve to align to the bottom of the page, while also being able to move up and down with the size of the browser window. http://www.woodrichwebworks.com/psa/psa_comps/bycor/html/redtest.html Any help would be great. I'm pretty new to css but now use one css file for all of the formatting of my entire website. The only problem I see with that (I say problem because I can't figure out a way around it) is that all of my hyperlinks throughout the website have only one normal state, hover state, active state and visited state. Is there a way to make more than one hyperlink set of formats? Like if I wanted to make one for each page? I could do something like ahomepage:link, ahomepage:visited, ahomepage:active or something??? Code: a:link, a:visited, a:active { font-size:12px; font-weight:normal; font-family: times; text-decoration:none; color : #000000 } a:hover { font-size:12px; font-weight:normal; font-family: times; text-decoration:underline; color : #000000 } Thanks for all the continued help/support. . . Makes learning CSS so much easier! Link: www.vairlinecms.com Question: I set the html up like this on purpose to grasp the concept. <p> tags are block level containers. So each new set of <p> tags should equal start on new line. w/the float property holding a value of left, it floats all content to the left. Since each instance of float occurs in its own container...the two different <p> sets should not be affected. In short, the password: paragraph should be on a new line, not both on the same line. There should be no need to clear it because they are in their own containers - which are block level. Where is my logic/understanding of CSS flawed? HTML: Code: <div id="clientLoginBoxBody"> <form action=#"> <br /> <p class="user">Username:</p> <p class="pass">Password:</p> </form> </div> CSS: Code: #clientLoginBoxBody p.user, p.pass { float: left; margin: 0; margin-left: 10px; padding: 0; font-size: 12px; text-align: right; } Question) In CSS can you line-height be set to a lower value than the current font size? What does this cause? potential answers (practise revision exam are) A) line-height cannot be set to a value lower than the current font size B) The lines are cut to prevent overlapping C) The lines will overlap I am pretty sure they overlap but want to confirm <div id="whatever"><img src="..." /></div> div#whatever { overflow: hidden; background-color: gray; } div#whatever img{ float:right; } When I set overflow: visible; the image is not properly wrapped within the div. When I set overflow: hidden; the image is properly contained within the div. (you can see with gray background) My question is, w3schools.com says that overflow property visible - show the content even if it overflows hidden - hide the part of the content that overflows With those definitions, I should be seeing the image chopped by div and don't even see it at all? html Code: Original - html Code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html> <head> <style = "text/css"> .main { width:200px; height:300px; position:absolute; background:yellow; top:0px; overflow:hidden; } .container { display:inline; position:absolute; width:100px; height:100%-; _height:100%; margin-bottom:auto; top:151px; bottom:0px; background:red; overflow:hidden; } .test { display:inline; position:absolute; width:100px; height:100%; background:blue; } </style> </head> <body> <div class ="main"> <div class="container"> <div class="test"></div> </div </div> asdfasasdfsdaf </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html> <head> <style = "text/css"> .main { width:200px; height:300px; position:absolute; background:yellow; top:0px; overflow:hidden; } .container { display:inline; position:absolute; width:100px; height:100%-; _height:100%; margin-bottom:auto; top:151px; bottom:0px; background:red; overflow:hidden; } .test { display:inline; position:absolute; width:100px; height:100%; background:blue; } </style> </head> <body> <div class ="main"> <div class="container"> <div class="test"></div> </div </div> asdfasasdfsdaf </body> </html> Basically I have a div that fills up the main div(main). The reason that there are 2 other divs is because one is slightly translucent and I didn't want the text to be translucent so it is for sitting on top of it and displaying the text, (I know it doesn't do that right now, this is just example code). My problem is that I want the div(test) to fill up the main div(main) from a certain point down, that is make it start 151px from the top and then expand until the bottom of the main div. I discovered that you can do this in firefox and opera by placing a - at the end of the height:100%. I don't know if this is correct, but it works. It does not work however in ie6. i can chop it using overflow:hidden;, but thats not really the functionality I want since the div in the final version will have a border on it. Is there someway to make it display the same way in Internet Explorer 6 as in firefox? Thanks akurtis Trying to use css to make a border around an element, and am using: .navbar { border: 1px solid red; } In IE, it puts a border around the navigational bar, but in FF, it only puts 1 line above it. Even if I try independently adding: border-left border-right border-bottom etc, it only shows above for border-top and border-bottom and nothing for left and right. I can place the code if needed, but I really just have a few words typed to try and get this to work. It's of strict doctype if that matters. Does FF have something special I need to add to get border to work? Thanks. |