Cascading Style Sheets, designing for the Web – Chapter 2. CSSThis is chapter 2 of the book Cascading. Style Sheets, designing for the Web, by H. The HTML specification lists guidelines on how browsers. For example, you can be reasonably. Also, you can pretty much. But beyond trust. CSS puts the designer in the driver's seat. We. devote much of the rest of this book to explaining what you can do. CSS. In this chapter, we begin by introducing you to the. Oracle acquired Sun Microsystems in 2010, and since that time Oracle's hardware and software engineers have worked side-by-side to build fully integrated systems and. CSS and HTML work. You can either. use a normal text editor and write the style sheets . The dedicated tools allow you to. CSS. language. However, in many cases the designer will want to tweak. CSSs by hand. Let's get started! A rule is a. statement about one stylistic aspect of one or more elements. A. style sheet is a set of one or.
You can download my template for the word "dream" here. The "d" and the "m" will print in two parts on two different sheets. Cut them all out and assemble into a.HTML document. The rule above sets the. It specifies. what elements are affected by the declaration. The declaration is that part of the. In the example. above, the selector is h. Any HTML element type can be used as a type. Type selectors are the simplest kind of selectors. We. discuss other kinds of selectors in. In the. previous example, it is color. In the example, it is. The curly. braces (. We figured. that if we could reduce the size of style sheets, we could enable. CSS therefore includes. For example, we. could write a style sheet with these two rules. H1 . A semicolon separates the declarations and may - . Also, to make your code easier to read, we suggest. However, you're not done yet. In order for the style. That is, the style sheet and the. HTML document must be combined so that they can work together to. This can be done in any of four ways. Apply the basic, document- wide style sheet for. We discuss. using the style attribute in Chapter. Here's a style sheet (shown in bold) glued to a. The result is shown in Figure. Among his works are. LI> the Goldberg Variations. LI> the Brandenburg Concertos. LI> the Christmas Oratorio. UL>. < H2> Historical perspective< /H2>. P> Bach composed in what has been referred to as. Baroque period. However, whereas the content of such elements as. Rather, it is the effect of the content of. So you don't see . No rules have. been added that affect any of the other elements, so those. Most browsers that are. CSS, for example Microsoft Internet. Explorer 4 (IE4), Netscape Navigator 4 (NS4) and Opera 3. O3. 5). Chances are that the people you communicate with have. CSS- enhanced browsers. If not, give them a reason to upgrade! When you start. experi. In general. newer browsers behave better than older ones. IE4 and O3. 5 are. Netscape's next offering - code- named Gecko - . CSS. CSS was carefully designed so that all. CSS. Some browsers, such as Netscape's Navigator version 2. Next. to supporting style sheets, this is the correct behavior. At the time of writing, only a few percent of Web. To avoid this, you can put. HTML. comment, which we discussed in Chapter. Because comments don't display on the screen, by. HTML comment, you prevent the. CSS- enhanced. browsers are aware of this trick, and will treat the content of. Here's an excerpt from the previous code. HTML comment. CSS is currently the only style. HTML docu. For XML the situation might be different. But just. as there is more than one image format (GIF, JPEG and PNG come to. So it's. a good habit to tell browsers that they are dealing with CSS. The value of type indicates what type of style sheet is. For CSS, that value is . If it does, it will. The type attribute (see. Chapter 1. for a discussion on HTML attributes) on the style element is a way to let the browser. The type attribute must be included. There are many reasons for having tree- structured. For style sheets, there is one very good reason. Just as children inherit from their parents, so do. HTML elements. Instead of inheriting genes and money, HTML. Among his. works are. LI> the Goldberg Variations. LI> the Brandenburg Concertos. LI> the Christmas Oratorio. UL>. < /BODY>. HTML> The tree structure of this document is. Through inheritance, CSS property values set on one. For. example, our examples have up to now set the color to be green for. Now, say, you would like to set the same color on all. You could do this by listing all. STYLE TYPE=. Instead of setting the. STYLE TYPE=. Since the body element. Sometimes, however, children don't. Not surprisingly, CSS also accounts for. Say you would like for h. This is easily. expressed in CSS. STYLE TYPE=. The first one sets the color of the. Which rule will win? Let's find. The reason why the second rule wins is that it is. CSS. is not a programming language, and in the above example, the order. The result is exactly the same if we use this style. STYLE TYPE=. Specificity is one aspect of. You can find the details in Chapter. We will use the background property (described in Chapter. This is. a common effect on the Web. In CSS, you can write. HTML>. < TITLE> Bach's home page< /TITLE>. STYLE TYPE=. When the image is loaded, the canvas looks like. There are a few noteworthy things in the above. The background image covers the surface like a. This is not due to inheritance, but to the. In case the. image can't be found, you will see the color instead. To. ensure contrast between the text and the background, it is a good. Visually, the. effect of transparency is similar to inheritance: it looks like. There are two reasons. Second, since. background images are aligned relative to the element they belong. Other common. tasks include setting fonts and white space around elements. This. section gives you a guided tour of the most commonly used. CSS. If you have used desktop. H1 . The first part of the value - . In the next chapter we will. The second part of the value - serif - tells the browser to use a font with. Chapter 5. will tell you all about them). The more decorated serif fonts. Bach's home page well since the modern sans- serif fonts. Here is the. The font property. By using it, you can shorten your style sheets and set. If you choose to use the. Here is. an example. UL . When set on the ul element, the li elements inside will become slanted. You can further. emphasize the list items by setting their ancestor to be bold. UL . The headline above this paragraph has space above it. This paragraph, as printed in. For example, it knows. Let's use the blockquote element as an example. Here's a. test document. HTML>. < TITLE> Fredrick the Great meets Bach< /TITLE>. P> One evening, just as Fredrick the Great was. With. his flute in his hand he ran over the list. BLOCKQUOTE>. In CSS, this space is called . The properties. are called: margin- top, margin- right, margin- bottom, and margin- left. You can change how the blockquote element is displayed by writing a. BLOCKQUOTE . So, the above example will result in. To make sure the. The result is. Just like font is a. The above example can. BLOCKQUOTE . From there. Setting. font- style to italic helps, and adding a background color. BLOCKQUOTE . Unlike previous examples, the color was specified in. RGB) components. RGB colors are described in. Chapter. 1. 1 . The space around. CSS has another kind of space, called padding. In other respects. Let's add some padding to the quote. BLOCKQUOTE . Just like the margin property, padding could have taken 4 values which. However, when the same value is to be set. This is true both for. See Space around boxes. HTML browsers have often underlined hyperlink. Also, various color schemes have been used to indicate if. Since hyperlinks. Web, CSS has special support. Here's a simple example. A: link . When authors do not. The interaction between author styles, browser. We will discuss the cascade. You probably . Pseudo- classes are used. For example, the author of the document can't. Pseudo- classes are. Chapter. 4, and we'll only give a few more examples here. A: visited . Assuming the user is moving a pointing device. A common effect is to change the background color. Here is. what it looks like. The : hover pseudo- class has an interesting. It was introduced in CSS2 after the hover effect became. Java. Script programmers. The Java. Script solution. CSS pseudo- class and. CSS picking up effects that have become. Web designers. This. Cascading is a fundamental feature of CSS, because we. Everything that the. However, we discovered that users, too, want the. With. CSS, they can do this by supplying a personal style sheet that. Usually, the designer's style sheet will have the. However, the user can say that a rule is. PL/SQL Quick Guide. PL/SQL - Quick Guide. PL/SQL - Overview. The PL/SQL programming language was developed by Oracle Corporation in the late 1. SQL and the Oracle relational database. Following are certain notable facts about PL/SQL . PL/SQL supports both static and dynamic SQL. Static SQL supports DML operations and transaction control from PL/SQL block. In Dynamic SQL, SQL allows embedding DDL statements in PL/SQL blocks. PL/SQL allows sending an entire block of statements to the database at one time. This reduces network traffic and provides high performance for the applications. PL/SQL gives high productivity to programmers as it can query, transform, and update data in a database. PL/SQL saves time on design and debugging by strong features, such as exception handling, encapsulation, data hiding, and object- oriented data types. Applications written in PL/SQL are fully portable. PL/SQL provides high security level. PL/SQL provides access to predefined SQL packages. PL/SQL provides support for Object- Oriented Programming. PL/SQL provides support for developing Web Applications and Server Pages. PL/SQL - Environment Setup. In this chapter, we will discuss the Environment Setup of PL/SQL. PL/SQL is not a standalone programming language; it is a tool within the Oracle programming environment. SQL* Plus is an interactive tool that allows you to type SQL and PL/SQL statements at the command prompt. These commands are then sent to the database for processing. Once the statements are processed, the results are sent back and displayed on screen. To run PL/SQL programs, you should have the Oracle RDBMS Server installed in your machine. This will take care of the execution of the SQL commands. The most recent version of Oracle RDBMS is 1. You can download a trial version of Oracle 1. Usually there are two files. We have downloaded the 6. You will also use similar steps on your operating system, does not matter if it is Linux or Solaris. Following is the first screen. You can provide your email ID and check the checkbox as shown in the following screenshot. Click the Next button. Step 2. You will be directed to the following screen; uncheck the checkbox and click the Continue button to proceed. Step 3. Just select the first option Create and Configure Database using the radio button and click the Next button to proceed. Step 4. We assume you are installing Oracle for the basic purpose of learning and that you are installing it on your PC or Laptop. Thus, select the Desktop Class option and click the Next button to proceed. Step 5. Provide a location, where you will install the Oracle Server. Just modify the Oracle Base and the other locations will set automatically. You will also have to provide a password; this will be used by the system DBA. Once you provide the required information, click the Next button to proceed. Step 6. Again, click the Next button to proceed. Step 7. Click the Finish button to proceed; this will start the actual server installation. Step 8. This will take a few moments, until Oracle starts performing the required configuration. Step 9. Here, Oracle installation will copy the required configuration files. This should take a moment . Just click the OK button and come out. Step 1. 1Upon installation, you will have the following final window. Final Step. It is now time to verify your installation. At the command prompt, use the following command if you are using Windows . It is always recommended to use the command files. To use the command files . Finally, just press Enter to execute the code, if it is not already executed. PL/SQL - Basic Syntax. In this chapter, we will discuss the Basic Syntax of PL/SQL which is a block- structured language; this means that the PL/SQL programs are divided and written in logical blocks of code. Each block consists of three sub- parts . It is an optional section and defines all variables, cursors, subprograms, and other elements to be used in the program. Executable Commands. This section is enclosed between the keywords BEGIN and END and it is a mandatory section. It consists of the executable PL/SQL statements of the program. It should have at least one executable line of code, which may be just a NULL command to indicate that nothing should be executed. Exception Handling. This section starts with the keyword EXCEPTION. This optional section contains exception(s) that handle errors in the program. Every PL/SQL statement ends with a semicolon (; ). PL/SQL blocks can be nested within other PL/SQL blocks using BEGIN and END. Following is the basic structure of a PL/SQL block . To run the code from the SQL command line, you may need to type / at the beginning of the first blank line after the last line of the code. When the above code is executed at the SQL prompt, it produces the following result . The identifiers consist of a letter optionally followed by more letters, numerals, dollar signs, underscores, and number signs and should not exceed 3. By default, identifiers are not case- sensitive. So you can use integer or INTEGER to represent a numeric value. You cannot use a reserved keyword as an identifier. The PL/SQL Delimiters. A delimiter is a symbol with a special meaning. Following is the list of delimiters in PL/SQL . All programming languages allow some form of comments. The PL/SQL supports single- line and multi- line comments. All characters available inside any comment are ignored by the PL/SQL compiler. The PL/SQL single- line comments start with the delimiter - - (double hyphen) and multi- line comments are enclosed by /* and */. The PL/SQL variables, constants and parameters must have a valid data type, which specifies a storage format, constraints, and a valid range of values. We will focus on the SCALAR and the LOB data types in this chapter. The other two data types will be covered in other chapters. S. No. Category & Description. Scalar. Single values with no internal components, such as a NUMBER, DATE, or BOOLEAN. Large Object (LOB)Pointers to large objects that are stored separately from other data items, such as text, graphic images, video clips, and sound waveforms. Composite. Data items that have internal components that can be accessed individually. For example, collections and records. Reference. Pointers to other data items. PL/SQL Scalar Data Types and Subtypes. PL/SQL Scalar Data Types and Subtypes come under the following categories . For example, the data type NUMBER has a subtype called INTEGER. You can use the subtypes in your PL/SQL program to make the data types compatible with data types in other programs while embedding the PL/SQL code in another program, such as a Java program. PL/SQL Numeric Data Types and Subtypes. Following table lists out the PL/SQL pre- defined numeric data types and their sub- types . A NUMBER variable can also represent 0. DEC(prec, scale)ANSI specific fixed- point type with maximum precision of 3. DECIMAL(prec, scale)IBM specific fixed- point type with maximum precision of 3. NUMERIC(pre, secale)Floating type with maximum precision of 3. DOUBLE PRECISIONANSI specific floating- point type with maximum precision of 1. FLOATANSI and IBM specific floating- point type with maximum precision of 1. INTANSI specific integer type with maximum precision of 3. INTEGERANSI and IBM specific integer type with maximum precision of 3. SMALLINTANSI and IBM specific integer type with maximum precision of 3. REALFloating- point type with maximum precision of 6. Following is a valid declaration . The logical values are the Boolean values TRUE and FALSE and the value NULL. However, SQL has no data type equivalent to BOOLEAN. Therefore, Boolean values cannot be used in . Valid dates range from January 1, 4. BC to December 3. AD. The default date format is set by the Oracle initialization parameter NLS. For example, the default might be 'DD- MON- YY', which includes a two- digit number for the day of the month, an abbreviation of the month name, and the last two digits of the year. For example, 0. 1- OCT- 1. Each DATE includes the century, year, month, day, hour, minute, and second. The following table shows the valid values for each field . LOB data types allow efficient, random, piecewise access to this data. Following are the predefined PL/SQL LOB data types . Cannot exceed 4 gigabytes (GB). BLOBUsed to store large binary objects in the database. TB)CLOBUsed to store large blocks of character data in the database. TBNCLOBUsed to store large blocks of NCHAR data in the database. TBPL/SQL User- Defined Subtypes. A subtype is a subset of another data type, which is called its base type. A subtype has the same valid operations as its base type, but only a subset of its valid values. PL/SQL predefines several subtypes in package STANDARD. For example, PL/SQL predefines the subtypes CHARACTER and INTEGER as follows . The following program illustrates defining and using a user- defined subtype . Note that NULL is not the same as an empty data string or the null character value '\0'. A null can be assigned but it cannot be equated with anything, including itself. PL/SQL - Variables. In this chapter, we will discuss Variables in Pl/SQL. A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in PL/SQL has a specific data type, which determines the size and the layout of the variable's memory; the range of values that can be stored within that memory and the set of operations that can be applied to the variable. The name of a PL/SQL variable consists of a letter optionally followed by more letters, numerals, dollar signs, underscores, and number signs and should not exceed 3. By default, variable names are not case- sensitive. You cannot use a reserved PL/SQL keyword as a variable name. PL/SQL programming language allows to define various types of variables, such as date time data types, records, collections, etc. For this chapter, let us study only basic variable types. Variable Declaration in PL/SQLPL/SQL variables must be declared in the declaration section or in a package as a global variable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
August 2017
Categories |