抹桥的博客
Language
Home
Archive
About
GitHub
Language
主题色
250
239 words
1 minutes
Frontend Development Learning Notes - Part 1

After recently finishing HTML and CSS and briefly looking into JavaScript, I followed a tutorial and built the page below. (This is the original design.)

1-1 I encountered some problems; for example, some rounded-corner buttons in the tutorial were implemented using a three-layer nested structure like <ahref=''><strong><span>HOME</span></strong></a>, with a background image set for each tag. This felt like more trouble than it was worth, when it could be achieved entirely with border-radius and a tiled background, resulting in simpler, cleaner code that also adheres to HTML’s semantic principles: Just <a>HOME</a>, and then simply setting a{border-radius:5px} in CSS. The implementation looks like this: 1-2

Another problem was the background of the main content area of the page, which was a white image with rounded corners and a shadow effect. The tutorial again used three sliced images combined with a three-layer HTML nesting to achieve this. In reality, this could also be done much more simply by using a rounded border, a white background, and then setting a shadow effect.

#Content{
background:#fff;
box-shadow:0 3px 5px#e4e4e4;
border-radius:25px25px 0 0;
}

The result is shown below: 1-3

However, there’s one problem with these solutions mentioned above: they all utilize new features from CSS3. Their effectiveness will be significantly reduced in older browsers, so it’s important to consider the requirements before deciding which method to use. Finally, here’s the screenshot of the finished page. Compared to the very first image, I think it looks pretty good. 1-4

This article was published on December 11, 2014 and last updated on December 11, 2014, 3951 days ago. The content may be outdated.

Frontend Development Learning Notes - Part 1
https://blog.kisnows.com/en-US/2014/12/11/learning-note-1/
Author
Kisnows
Published at
2014-12-11
License
CC BY-NC-ND 4.0