Jump to content

kelly2marie

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by kelly2marie

  1. I am assuming your are trying to print a web page?? I'm hoping it's your own web page?? If so, you need to create a print style sheet that defines the background colors you want to show up when printing.
  2. In regards to <center><div id="container"> If you are trying to center the div itself, specify a width AND auto margins for the left and right. (the width can be pixels, ems, or percentage) #container {width:90%; margin:0 auto;} If you need to center content within a particular div, then you would use text-align:center as follows: #container {text-align:center;} Or............. let's say you would like to center the contents of a paragraph using an inline style.... HTML: <p style="text-align:center;">Content here. </p> Or, create a class on your external style sheet called "center" as follows.... .class {text-align:center;} Then apply this class to the element you want to center the content, such as a paragraph.... <p class="center">Content here.</p>
  3. You can use the !important declaration for the color property. color:white!important; That will force the text to be white regardless of any inheritance or any other reason. But, use this as a last ditch effort. In your situation, it may be the solution.
  4. Take a look at this: http://www.456bereastreet.com/lab/equal_height/ shows you how to create equal height boxes using the display property: such as display:table, etc. This means you will not need to use ap divs! You won't have to screw around with margins etc. And you will have equal height boxes.
  5. absolute positioning can be used any time you need a 'Layer' (sometimes called an AP div). Basically, a Layer is a div tag given 'absolute' position: <div id="layer1"></div> #layer1 { position:absolute; width:200px; height:200px; } Any time you use absolute positioning, you must set a height and width, though there are some exceptions to this. You can also use the following CSS Properties to help position your layer: top right bottom left z-index The problem with Layers is that they are not nearly as flexible as we need them to be. This is mainly due to the fact that they are removed from the normal flow of the page. Meaning, a Layer is positioned according to the x and y axis. Other elements completely ignore Layers. This is a major reason we avoid using them. But any time you need to overlap an element, a Layer is perfect for the job. Just be sure to set 'position:relative;' on the containing div. That way, your Layer will be positioned according to the edges of the containing div, thus giving you better control over positioning.
  6. <div class="thumbnail"></div> .thumbnail { width: 227px; height: 237px; } Now, if you are experiencing margin collapse or really it's an escaping margin, then you have two options. 1) Add a border around the div. 2) Add a pixel of padding on top and on the bottom. Also, be sure to zero out margins and padding, typically done with a css reset, or on the body style. So....... body { margin:0; padding:0; } .thumbnail { width: 227px; height:237px; border: 1px solid #33333; }
  7. Actually, to make 2 columns side by side, give the first div (column) a width and float to the left. The second div (column) just needs a left margin that is equal to or greater than the width of the first column. That would make this right column expand to take up the room leftover. <body> <div id="wrapper"> <div id='leftcol"></div> <div id="rightcol"></div> </div> </body> #leftcol { width: 240px; float: left; } #rightcol { margin-left: 240px; } Keep in mind, the source order of the divs is important when you float only one of them. The floated column (div) needs a width and it needs to be inserted before the non-floated column.
  8. dsonesuk is right. in addtion, if you set a width at 100% and add a border, this too will trigger a horizontal scroll bar. However, to avoid these issues with padding, margins, and borders and the default css box model, we can add a css3 property called "box-sizing". Basically, we use that to change the way the box model is applied, in other words, change the way padding, margins, and borders behave by default which is additive. meaning, if you add any of these properties to block box that has a width specified, it causes the entire width of the element to increase. use box-sizing with a border-box value, and that problem goes away entirely. So, add the following style to your css reset (at the beginning of your style sheet: *, *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } You can learn more about css3 box-sizing property at: http://www.w3schools.com/cssref/css3_pr_box-sizing.asp and https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing
  9. To make the divs fluid, you can set their widths to percentages. In addition, it sounds like you are looking for info about Responsive Web Design. Here you begin with a fluid layout, then use Media Queries to create a different set or sets of CSS Styles for different Device sizes. (Take a look at kellys-tutorials.com/demo. This is a current site I am building to be Responsive. Resize the browser width and watch as the layout changes. Just keep in mind, I am in the early stages of this site, and it needs work. But you should get the idea. Go ahead and look in the code and css. take whatever code you need to help you.) For a quick Tutorial, but not an ideal method, take a look at http://webdesignerwall.com/tutorials/responsive-design-in-3-steps. For an entire site, I would use a Mobile First Approach and would make my layout fluid from the beginning, not just in the media queries. I can't put all this in here as entire books are written on the topic. See http://alistapart.com/article/responsive-web-design for more info. Hope this helps somewhat.
  10. First, it's great that you noticed this! Here's what I would do, or one could do............. <section id="top"> -- omit div -- <ul class="list fl"> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Services</a></li> <li><a href="#">Blog</a></li> </ul> <ul class="fr"> <li><a href="#">Grab our Feeds</a> etc................... </ul> </section>
  11. You know, I started writing this thinking you needed help!! I got to the part where you said "it was still kind of fuzzy to you". I apologize!! Yet, I decided to continue on and post this. It took me a while to write! so I am posting it!! lol I too hope this helps Someone!! Anyone!! First, let me say this: KEEP IT SIMPLE!!!! CSS Syntax selector { css-property: value; css-property: value;} You can group Selectors using a combinator, such as a comma which means "AND". An empty space means something all together different!! It implies descendancy. Check out this Video: YOUTUBE (See attached infographic) Okay, let's move along. Executed...... sequentially.... Not so sure I would say it that way. But, the web browser has a mechanism called the "Cascade". The Cascade is meant to decide which Style will be applied should there be conflict.. .... Conflict among Styles means there is more than one Style that targets the same element and has the same Media Type. Instead of the word Executed, the W3C CSS2.1 specs say,"Once a user agent has parsed a document and constructed a document tree, it must assign, for every element in the tree, a value to every property that applies to the target media type." (go to http://www.w3.org/TR/CSS2/cascade.html to read all about the Cascade.) What you are actually referring to is the Cascade of Styles. But, instead of "undeclaring a style", we can Override a Style. Yes, the order in which the Styles are specified on the External Style Sheet (or any type of style sheet) plays a role in determining which styles get applied, assuming there is conflict (or you are trying to override a style). But there are other factors that determine how the Styles Cascade, and which get applied should there be conflict. (Inline Styles override Internal & External Styles; Specificity: the most specific Selector will usually win; As will !important declarations. Author Styles usually override Browser Styles, etc) Object Types... this is not quite the correct terminology. I think you really mean to say Elements or Tags. (You must be a coder using the DOM!) And it is true, we typically specify more general styles initially, and later on override those styles with increasing Specificity.... to some degree. EXAMPLEFor instance, CSS Inheritance can really save a lot of time when writing CSS. Inheritance is another factor that plays into the Cascade of Styles. A perfect example is styling the <body> of the web page.......................... To do this, we use a Tag or Element Selector, which is General to some extent. body { font-family: Arial, Helvetica, sans-serif; } The CSS Property, font-family, is a property that can be inherited from Parent Elements, or Ancestors in the Document Tree. CSS Inheritance is the process in which certain CSS Properties can be passed down from Parent to Child, or Ancestor to Descendant. Thus, by setting the font-family on the body style, EVERY ELEMENT on the Page will Inherit that font-family. Soooo.... we only need to specify that font-family one time via the body style, UNLESS we want to override that font-family as we likely would when styling heading tags. Thus, my next style would be the following........ h1, h2, h3, h4, h5, h6 { font-family: Oswald, sans-serif;} This style is still quite general, but it will override the font-family that is passed down from the body, causing all heading tags to have Oswald as their font. Once we get the Layout made, we can make our Heading Styles much more specific thereby style h2 headings in different parts of the layout uniquely if we so desired. Each section of the Layout can be given an id, which we would style with an ID Selector. For instance, <div id="header"> </div> or <header id="header"> </header> #header { height: 100px;} Notice how the ID selector matches the id attribute. That is how we hook some css styles to the html markup. Now let's assume you have an h1 Heading for your onpage title, and an h2 Heading for the Tagline. We would get very specific and use the following Selectors........ #header h1 { ... }#header h2 { ... } Then, the h2 Headings in the #main-content section of the web page can be styled using the following Selector: #main-content h2 { ... } SELECTORSRemember to avoid the term "Objects". They are elements in the document tree. (The DOM is where Objects come into play.)**And there are MANY MANY different types of Selectors but Beginners need to first learn the basic ones: [*]ID selectors[*]Class selectors[*]Tag or Element Selectors[*]Dynamic Pseudo Class Selectors (a:link, a:visited, a:hover, a:active, a:focus)[*]Descendant Selectors (#header h2 is a descendant selector - meaning we are styling nested elements.) Okay, there are times when you will use a Class selector without an Ancestor. ***Remember, class selectors can be applied to a given web page numerous times. ID selectors, on the other hand, must be unique and can be applied only one time on a given page. Therefore, you will find times when you need to create a class for the purpose of applying it to a portion of an html element. This does not require the ancestor in the selector. Perfect Example: I often create various styles to apply to some text or a few words in my paragraphs. .bold-red { font-weight: bold; color: #ff0000; } This style can be applied over and over again on the same page, and it is Independent of any Ancestor. And.... I often apply that class to a portion of an html element, not the entire element. <p>Lorem ipsum dolor sit amet, <span class="bold-red">consectetur adipiscing elit</span>. Nunc sit amet porttitor nibh. Ut mattis rutrum enim, sed fringilla metus semper nec.</p> Another Class I like to create and use a lot: .center { text-align:center; } I don't like to center all of my text. That looks aweful. However, from time to time, I do like to center the text within a particular paragraph. In that case, the class .center must be applied to the <p> element and NOT to the text in that <p> element. <p class="center"></p> will cause the text in this p tag to text-align center. You can read more about Using Class Selectors. phew... I need a nap now!! Best wishes to all CSS Authors out there! And Aspiring Authors!!
  12. Here's what you need to do in order to do better troubleshooting.... Use Mozilla Firefox browser. Then get an addon called Firebug. Once you have Firebug, then view your page in Firefox, right click where ever you have a problem and choose Inspect with Firebug. Firebug will open in the bottom of the window. Now click on the particular HTML in question and firebug will highlight that area on the page plus show you the existing CSS being applied to that element. You can turn off any CSS Style to see what happens. This process will help you figure out what to change. You still have overflow set to hidden and still have -13px margin on the ul. Instead of hiding overflow, clear the float. You also need to add a small margin on the left of each image to create space between the images.
  13. I agree that there is not enough space available. However, let's back up a bit... you have overflow set to hidden. I would remove this, and instead, clear the float to keep the content beneath from floating upwards. Hiding overflow is part of the reason you do not have enough space. Another reason: remove the -13px margin from the <ul> element. You will have to investigate further by experimenting in order to find other reasons for lack of space. Though I think you will find removing hidden for overflow is going to help you out quite a bit!!
  14. I would remove the symbol from the selector and class attribute so that your selector is just .introheader. Also, remove <sup></sup> that you have wrapped around the symbol in the html. Assuming you are using the Text in a Heading tag, here's the HTML: <h1>My Product<span class="introheader">®</span></h1> The CSS: h1 { font-family: Verdana, Helvetica, sans-serif; font-size: 28px; etc... } .introheader { font-size: 13px; vertical-align: 12px;} I created a fiddle at http://jsfiddle.net/kelly2marie/47XtJ/ The vertical-align Property can be given any one of the following values: super sub baseline bottom middle etc etc... Or use a value. That's what I did because I didn't like the look super had. It needed to go up higher just a bit so I went with 12px for the vertical alignment. Give this a whirl.
  15. Do you have any code you can show us??? By the way, I did a search and found something called "Responsivizer", which is a Joomla extension. Says no need to to do a complete rebuild and works on most joomla versions. consider looking at this. it's also suppose to work on ipads etc.
  16. Use CSS. Use :focus as part of the selector. For instance, let's suppose you want the input fields of a form to change color when it "has the focus" (viewer clicks inside the input box or other html element), create a selector similar to this.... input:focus {background-color: #cc0000; color: #fff;} You could do this to a div: div:focus {...} I recommend making your selectors as specific as possible. Or course, div:focus{...} would impact all divs, not really what you want. Just keep this in mind.
  17. First, remove the <style> tag that you have below the doctype. Second, you are missing the opening <html> tag that should immediately follow the doctype. Some browsers may have an issue with this. Especially Internet Explorer. The barebones html document should have at least the following: <!DOCTYPE html><html><head><meta charset="charset=utf-8"><title>Title goes Here</title></head> <body> </body> </html> If you want to use an Internal Style Sheet for your CSS, do so like this: <!DOCTYPE html><html><head><meta charset="charset=utf-8"><title>Title goes Here</title> <style type="text/css"> ..... put styles here...... </style></head> . . . . . As far as the a:visited, you do not have this as specific as it needs to be, so it will affect all hyperlinks that have been visited. For instance, #top_menu a, a:visited{ is not correct. Try using this: #top_menu a, #top_menu a:link, #top_menu a:visited {....} Then add: #top_menu a:hover {...} In general, when styling hyperlinks, you must specifiy the selectors in a specific order or they will not work correctly. The order is as follows: a:link a:visited a:hover a:active just remember to make each of the above selectors specific as I explained earlier. Try these changes I mentioned, and see what happens.
  18. Are you looking to center the table? If so, the best way to do that is to wrap the table with a div tag and center that div tag with CSS. (give the div a width and auto margins for the left and right) Are you looking to align text? In a certain cell? such as th (table header) or tr (table row) or td (table cell)? Use the CSS text-align property with an appropriate selector. So you may want to begin by learning about CSS Selectors and how to use them. You could possibly give your table an id..... meaning an id selector. This helps provide specificity in your css styles. Ex: <table id="admins"> .....etc. Of course, you name the id, then create the selector to apply to the table with that id selector. Ex <table id="admins"> </table> your CSS would look like: #admins {width: 800px; border: 1px solid #333; background-color: #cdcdcd;} <-- this style targets the table with the id of "admins". Now when you want to style the cells, rows, header etc of the table, you will begin your selectors with #admins followed by a tag selector that targets th, td, tr, or any of the other possible table elements. Ex Let's style the table header <th></th> #admins th {......} Style the table row with ... #admins tr {......} You can also add classes to style rows differently or columns differently. For instance, style the first row of the admins table so that the background is different from the rest of the rows ..... 1. Create a class style: .light-color {background-color: #f6f6f6;} 2. Next, add class="light-color" to the <tr> element in the html.... <tr class="light-color"> Now whatever background color you assign to .light-color will be applied anywhere you use the class "light-color". Hope this gives you a better understanding. Go through w3Schools CSS tutorials to learn more.
  19. One of the best ways to determine what is going on is to use Firefox with an addon called "Firebug". It allows you change the CSS for the selected html element to see what happens. You can turn off certain styles or property:value pairs to see the impact this has on the page. You can also write property: values to see what happens. (Or, you can use Google Chrome which has "Inspect Element" when you right click. No need to install anything.) Basically, right click on the area or extra space, and choose "Inspect with Firebug". Of course, you first have to install the Firefox addon. Anyway, firebug will open that portion of the html where you right clicked. Click on an html element and look at the CSS off to the right. That's where you can turn off css properties. I did take a look with Firebug, and this is a tough one, so don't give up quickly. I think newseed's response will get you in the right direction. In addition, look at the following screenshot....http://expression-web-tutorial.com/firebug.html the #primary div is highlighted in the page. For this div, remove the widths entirely and set the right margin of approximately 300px or greater. This div should not extend clear across the page when highlighted. This highlight should stop where the right sidebar begins. Basically, you float one column (the right sidebar), then the second column is not given a width, instead, just add a right margin that is equal to or greater than the width of your right column. Go over your styles and be sure you have just one width for the right sidebar. Also, insert the floated column first (source order matters when floating), the non floated next. You have done this correctly. Notice the CSS in the screenshot for #primary (line 35)...... get rid of float:none, get rid of z-index. The z-index has no impact when styling a static div. (use z-index with absolute positioning to set the stacking order.) Change margin: 0; to margin-right: 300px; or more. Then for #primary (line 117): DELETE IT all together. Not needed. The width should not be set on this div (unless you decide to float this div).
  20. Hi Everyone! My name is Kelly Lucas, 46 wf from Pennsylvania, and I am a Web Designer and Teacher of Web Design. My specialty is CSS. You can find me at www.Expression-Web-Tutorial.com where I provide free tutorials as well as training DVDs and Online classes for Expression Web and Dreamweaver. I've been teaching beginners and designing for nearly 6 years. You can read "About Me" on my site (www.Expression-Web-Tutorial.com/About-Me.html). Interests: I love to learn! Right now I am learning how to develop web sites and applications with asp.net web pages 2.0 with Razor and C# via WebMatrix. I hope to move onto asp.net mvc and forms very soon. However, my goal right now is to be able to create Membership sites so that I can generate more income from my design projects. When I say membership sites, I'm referring to user login/registration system. WebMatrix from Microsoft is a nifty and powerful tool. it includes IIS server and SQL Compact for databases. The site, asp.net, has really great tutorials, plus I've been using w3schools site to learn about Razor with C#, and other miscellaneous things. It's going quite well. FYI: for anyone seeking to advance their skills, I highly recommend mastering CSS as much as possible as a beginner. CSS is used in many environments, including asp.net. Gotta style those pages. And you don't want to use a bunch of inline styles or internal styles. i often send students to w3schools.com, and finally decided to sign up for the forum so that maybe I can help answer some questions, especially the CSS questions. Happy to be here, Kelly
  21. Here's what I would do to avoid the entire issue: HTML: <!DOCTYPE html><html> <head> <link type='text/css' rel='stylesheet' href='reset.css' /> <link type='text/css' rel='stylesheet' href='styles.css' /> </head> <body> <div id='wrapper'> <div id='header'> <h1>VMCS</h1> </div> <div id='nav'> <ul> <li><a href='http://www.apple.com'>Members</a></li> <li><a href="http:www.google.com">About Us</a></li> </ul> </div> <div id='content'> <h2>this is an h2 typing</h2> <p> this is the words on screen</p> </div> </div> </body></html> CSS: body{ background-color: #121212; background-image: url(images/body.png); background-repeat: repeat-y;}#wrapper{ background-image: url(images/tapestry1.jpg); background-repeat: repeat-y; width: 900px; height: auto; margin: 2%; margin-left: auto; margin-right: auto;}h1{ color: rgba(1,1,1,.1); font-size: 4em;}#header{ background-image: url(images/headerbg.png); border-radius: 0px 128px 0px 0px; height: 310px; margin-bottom: 10px; border: 5px solid red;}#content{ font-size: 1em; margin: 30px; height: 400px}#nav { height: 135px;}#nav ul { margin-top: 15px; margin-right: auto; margin-left: auto; width: 537px;}#nav ul li { float: left; height: 80px; line-height: 2.9; width: 265px; text-align: center; list-style-type: none;}#nav a, #nav a:link, #nav a:visited { font-size: 2em; border: 3px solid green; display: block; color: #000080;}#nav a:hover { background-color: #008000; color: #FFFFFF;} I added a hover in there for you. Now, if you want to modify the height of your link boxes, modify the #nav ul li style. If you modify that style, you will then have to modify the line-height in the same style so as to keep the text centered vertically.
  22. Use RGBa color codes. The a is "alpha" for opacity. The text will not inherit this opacity. RGBa: Red - Green - Blue - Opacity div {background-color: rgba(0, 0, 0, .5); The above rgb code is black, and the opacity level is set to .5 or 50%.
  23. I made up a quick fiddle so you can see this in action. Go to http://jsfiddle.net/kelly2marie/H8R8m/ Be sure to change the scale value to see the effect it has.
  24. Use the CSS3 Transform property and use the scale function on hover, just as punterf16 said. All other ways have too much coding. First, you need a css selector to target the image. You can create a class or you can use the img tag selector. But I would suggest making the selector as specific as possible so that only the images you want to scale up on hover do so. So, begin your selector with whatever div you are working in. Suppose the div has an id of "main" and the image you want to scale on hover is a child of the main div.... #main img:hover { transform: scale (1.1); } Now you may have to add vendor prefixes to the property declaration, such as -moz, -webkit. Go to caniuse.com to see what browser support is like for any CSS3 property. With Vendor Prefixes: #main img:hover { -webkit-transform: scale(1.1); -moz-transform: scale(1.1); -ms-transform: scale(1.1); -o-transform: scale(1.1); transform: scale(1.1); } Look up Vendor prefixes so you understand which prefix targets which browser.
×
×
  • Create New...