« Home « Chủ đề CSS

Chủ đề : CSS


Có 60+ tài liệu thuộc chủ đề "CSS"

Tự học HTML và CSS trong 1 giờ - part 32

tailieu.vn

The optional align attribute of the <caption>. tag determines the alignment of the cap- tion. There are four values for the align attribute of the <caption>. By default, the caption is placed at the top of the table ( align=“top. You can use the align=“bottom” attribute to the caption if you want to put the caption at the bottom of...

Tự học HTML và CSS trong 1 giờ - part 33

tailieu.vn

<td>10mm</td>. <td>5-7mm</td>. <td rowspan=”2”>5-7mm</td>. <td style=”text-align: left”>Models with AC</td>. <td>12mm</td>. <td>6-8mm</td>. <td>12.5mm</td>. <td>7.9mm</td>. Under normal circumstances, avoid the use of the style attribute and instead use a style sheet for the page and apply classes where necessary to style your table. The <colgroup>...</colgroup>. You want each of the six columns to be 75 pixels wide. </colgroup>. <colgroup>. Start by defining...

Tự học HTML và CSS trong 1 giờ - part 34

tailieu.vn

Used to set alignment of all cells in a column. Used to set alignment of all cells in a column group. <table>. Determines the alignment of the table and indicates that text following the table will be wrapped alongside it.. Indicates which side of the table the caption will be placed. In Internet Explorer, the possible values are left ,...

Tự học HTML và CSS trong 1 giờ - part 35

tailieu.vn

<form action=”/form-processing-script” method=”post”>. <label for=”username”>Username</label>. <input type=”text” name=”username” />. <label for=”password”>Password</label>. <input type=”password” name=”password” />. <input type=”submit” class=”submit” value=”Log In” />. </form>. Let’s look at the style sheet for the form.. First, I added 5 pixels of margin to the bottom of the <div>. elements to space out the form elements a bit. Then, I used CSS to align the...

Tự học HTML và CSS trong 1 giờ - part 36

tailieu.vn

<label><input type=“checkbox” name=“symptoms” value=“nausea” />. Nausea</label>. <label><input type=“checkbox” name=“symptoms” value=“lightheadedness” />. Light-headedness</label>. <label><input type=“checkbox” name=“symptoms” value=“fever” />. Fever</label>. <label><input type=“checkbox” name=“symptoms” value=“headache” />. Headache</label>. When this form is submitted to a script for processing, each check box that’s checked returns a value associated with the name of the check box. When you asso- ciate a label with a check box...

Tự học HTML và CSS trong 1 giờ - part 37

tailieu.vn

enctype=“multipart/form-data”>. Here’s the name input:. <label class=”required field” for=”name”>Name</label>. <input name=”name” />. <label class=”required field”>Gender</label>. <label><input type=”radio” name=”gender” value=”male” />. male</label>. <label><input type=”radio” name=”gender” value=”female” />. female</label>. Here’s an instance where I used the <label>. As you can see, I used the approach of putting the <input>. tags inside the <label>. <label class=”required field”>Operating System</label>. <select name=”os”>. <option value=”windows”>Windows</option>. <option...

Tự học HTML và CSS trong 1 giờ - part 38

tailieu.vn

input[type=”text. One catch is that the attribute has to exist, so I had to add type=”text” to my <input>. However, I moved the required class to the enclosing div so that I can also use it in selectors that match the form fields themselves. The full source code for the page, including the form updated with classes, follows:. <style type=”text/css”...

Tự học HTML và CSS trong 1 giờ - part 39

tailieu.vn

First, however, it’s worth discussing the way the vast majority of videos are embedded in web pages these days. You can see the form that allows you to generate the embed code for YouTube in Figure 12.1.. FIGURE 12.1 The embed form on YouTube.. If you want to add a video hosted on YouTube, you just click the Embed button...

Tự học HTML và CSS trong 1 giờ - part 40

tailieu.vn

If it’s not, encode the video again using different settings. Afterward, watch the video and make sure that it still looks okay.. In the early days of the Web, to present video, the best approach was just to link to video files so that users could download them and play them in an application other than their browser. When browsers...

Tự học HTML và CSS trong 1 giờ - part 41

tailieu.vn

adding the <object>. Here’s the code:. <script type=”text/javascript” src=”swfobject.js”></script>. <script type=”text/javascript”>. <object id=”myId” classid=”clsid:D27CDB6E-AE6D-11cf-96B . width=”780” height=”420”>. <param name=”movie” value=”myContent.swf” />. <object type=”application/x-shockwave-flash” data=”myContent.swf” width=”780”. height=”420”>. </object>. Here’s the line between the opening and closing <script>. As you can see, SWFObject requires the ID of the <object>. <div id=”myContent”>. As you can see, the main difference is that the <object>....

Tự học HTML và CSS trong 1 giờ - part 42

tailieu.vn

<object>...<object>. <param>...</param>. FIGURE 13.1 The Dunbar Project’s original website.. LISTING 13.1 Using <div>. <div id=”header”>. <div id=”sitenav”>. <ol><li><a href=”index.html”>Home</a></li>. <li><a href=”about/”>About the Dunbar Project</a></li>. <li><a href=”gallery/”>Photo Galleries</a></li>. <li><a href=”donate/”>Donate</a></li>. <li><a href=”contact/”>Contact</a></li></ol>. </div>. <div id=”main”>. <div id=”content”>. <img src=”DunbarTop.jpg” alt=”[Dunbar School]”>. The school was named after <a href=”poet.html”>Paul Laurence Dunbar</a>, a renowned African-American poet.. When segregation in Arizona was eliminated, Dunbar...

Tự học HTML và CSS trong 1 giờ - part 43

tailieu.vn

n The first rule sets the margin and padding of the <body>. n The #sitenav rules in Listing 13.2 are used to turn the ordered list of links into a horizontal navigation bar.. n The #main section is also given a large padding on the right, 12em . This is where the #sidebar will be located.. n Absolute positioning is...

Tự học HTML và CSS trong 1 giờ - part 44

tailieu.vn

ptg LISTING 13.6 Continued. 11.5em. margin-right: 11.5em. margin-top: 1.5em. CSS rules are easily obfuscated if you’re not careful. discipline is necessary to keep the style sheet readable.. The style sheet in Listing 13.7 is really the same style sheet as in Listing 13.6. Both are valid style sheets and both produce the same results when applied to the web page,...

Tự học HTML và CSS trong 1 giờ - part 45

tailieu.vn

on the page. As you can see, document.write() adds text to the page source. What this code does is call the write method of the document object, which takes a single parameter—the text to be added to the page. For now, it’s important to know that the document object is a repre- sentation of the current page that is accessible...

Tự học HTML và CSS trong 1 giờ - part 46

tailieu.vn

If you are passing arguments to a function, they are included in the parentheses in a comma-separated list.. Even if you’re not using arguments, the parentheses are still required. This is true whether you’re calling a function you wrote yourself or a function that’s built in to JavaScript.. I’ve mentioned JavaScript’s type system, but I haven’t talked much about JavaScript...

Tự học HTML và CSS trong 1 giờ - part 47

tailieu.vn

It’s shown again in Figure 15.1. What happens when this form is submitted? In the real world, a script on the server side validates the data that the visitor entered, stores it in a database or file, and then thanks the visitor for her time.. But what happens if a visitor doesn’t fill out the form correctly—for example, she doesn’t...

Tự học HTML và CSS trong 1 giờ - part 48

tailieu.vn

FIGURE 15.5 The FAQ page with the JavaScript included.. Here’s the JavaScript contained in the faq.js file:. ptg This JavaScript code is significantly more complex than any used previously in the book.. onload attribute of the <body>. tag to start up the JavaScript for the page, I assign an anonymous function to the onload property of the window object. You...

Tự học HTML và CSS trong 1 giờ - part 49

tailieu.vn

It also explained how you can manipulate the styles on a page and even the contents of a page using JavaScript. The final two examples were written in a style referred to as unobtrusive JavaScript, which involves writing JavaScript in such a way that the page still works even if the user has disabled JavaScript, or their browser does not...

Tự học HTML và CSS trong 1 giờ - part 50

tailieu.vn

Modifying Styles on the Page. Another powerful feature of jQuery is that it enables you to modify styles on the page on-the-fly. jQuery enables you to modify the page styles indirectly through convenience methods that hide and show elements, for example, and also enables you to directly mod- ify the page styles.. For example, you can hide and show elements...

Tự học HTML và CSS trong 1 giờ - part 51

tailieu.vn

In this case, I put the value in the. tag, and pass that to the append() method. I also remove the content from the text field because it has been appended to the list. Figure 16.13 shows the list once a few elements have been added.. FIGURE 16.13 A page that allows you to add and remove content on-the-fly.. Finally,...