Jump to content

kelly2marie

Members
  • Posts

    25
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

kelly2marie's Achievements

Newbie

Newbie (1/7)

1

Reputation

  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.
×
×
  • Create New...