Code promo color box
Lets cdiscount start from scratch and recode the entire CTA so you can see the basic process involved in coding clean and meaningful html and CSS.
So we cdiscount need to figure code out what our color CTA boxes all code have in common, and apply those visuals globally via CSS.First, lets strip down our html to ensure we have as little markup as possible.What is often tomtom troublesome code about color these boxes is that, more often than not, they dont contain consistent content.If were not careful, our CTAs can suffer promo from divitis, too many attributes, and CSS-overload.The code above centrale is not really all that bad; its promo commented, its well-indented, and its W3C compliant but promo promo its not as efficient as it could.Here is the same html page with the improved code (opens in a new window). But by simplifying our code, weve accomplished quite a euros bit: Weve made our html much more readable and semantic, without attribute-overload; weve made our CTA more adaptable to future edits and changes; and weve stripped 15 lines from our CSS code (53 lines compared.
During checkout, you will need to fill out your registration information and select your industry that you are euros applying the job for.
Heading centered, left-aligned, black paragraph text, centered text link 12 pixels of top padding 10 pixels of left and right padding.
If we can euros strip 15 lines of CSS code for every 3 div tags, well be well on our way to a much more efficient and faster loading website.Content for promo area.The rest of the styles are specific to a single box, so well deal with them later.They might have promo different bijoux colored titles, different background images, variations in text size, and.Although the margin and background image will be overriden in subsequent styles for one or more of the other boxes, they can be applied in the promo globals to save us code a few keystrokes later.The 15 lines might not euros seem like a lot but keep in mind this is just one section of our home page.p p class"center" a href"promo_ml" id"promo_link_3" Read More cdip /a /p promo /div!- promo_3 ends - /div!- promo_holder ends - The CSS: #promo_holder clear: both; width: 751px; height: 250px; margin: auto; #promo_holder.center text-align: code center; #promo_1 float: left; width: 223px; padding: 12px 10px 0 10px; height: 238px;.Please dont promo be too flabberghasted by the beautiful design!You will find apply the coupon info promo on the same page too.Doing front-end development for a full service web design company means Im often involved in very high-end, corporate websites that require styling call to action (CTA) or promo areas on the home page.
Well also change our primary promo IDs to classes, and remove all extras except the center class on the p tags, which we still need: div id"promo_holder" div class"promo" h2 Title Number One /h2 p Content for promo area.
p p class"center" a href"promo_ml" Read More /a /p /div!- promo_1 ends - promo div class"promo" h2 Title Number Two /h2 p Content for promo area.
Weve also grouped our h2 and a tag styles to ensure they are centered.