Home 1.604.763.2828 Vancover, Canada
PrimeObjects Products & Features Consulting Partners Blog and Communitiy About Us
Intelligent Business Knowledge Management Products & Features Consulting Partners Blog & Community About Us Sign up, 7 days free Login >>
PrimeObjects Developer Updates

Monday, September 12, 2011

The 3 ways that HTML elements can be displayed

Source: PrimeObjects Developer Updates
Tags: 

All HTML elements are naturally displayed in one of the following ways:

Block
Takes up the full width available, with a new line before and after (display:block;)
Inline
Takes up only as much width as it needs, and does not force new lines (display:inline;)
Not displayed
Some tags, like <meta /> and <style> are not visible (display:none;)

Block example

<p> tags and <div> tags are naturally displayed block-style.

(I say “naturally” because you can override the display style by setting the CSS display property e.g. display:inline;.)

A block-display element will span the full width of the space available to it, and so will start on a new line in the flow of HTML. The flow will continue on a new line after the block-display element.

Here I’ve started a paragraph and now I’m going to insert a <div>

new div inside my paragraph

and then continue the text here…

See how the <div> jumped in and took over the full width of the space?

Common HTML elements that are naturally block-display include:

<div>
Your general-purpose box
<h1> … <h6>
All headings
<p>
Paragraph
<ul>, <ol>, <dl>
Lists (unordered, ordered and definition)
<li>, <dt>, <dd>
List items, definition list terms, and definition list definitions
<table>
Tables
<blockquote>
Like an indented paragraph, meant for quoting passages of text
<pre>
Indicates a block of preformatted code
<form>
An input form

Inline example

Inline-display elements don’t break the flow. They just fit in with the flow of the document.

So here I’ve got a paragraph going on, and I’m going to add a <span> tag that has a yellow background and italic text. See how it just fits right in with the flow of the text?

More elements are naturally inline-style, including:

<span>
Your all-purpose inline element
<a>
Anchor, used for links (and also to mark specific targets on a page for direct linking)
<strong>
Used to make your content strong, displayed as bold in most browsers, replaces the narrower <b> (bold) tag
<em>
Adds emphasis, but less strong than <strong>. Usually displayed as italic text, and replaces the old <i> (italic) tag
<img />
Image
<br>
The line-break is an odd case, as it’s an inline element that forces a new line. However, as the text carries on on the next line, it’s not a block-level element.
<input>
Form input fields like and
<abbr>
Indicates an abbr. (hover to see how it works)
<acronym>
Working much like the abbreviation, but used for things like this TLA.

You change the display property of any elements

Although each HTML element has its natural display style, you can over-ride these in CSS.

This can be very useful when you want your page to look a particular way while using semantically-correct HTML.

Examples

Say you want to provide a list of items, but you don’t want a big bulleted list. You just want to say that you’re going to the store to buy:

  • some fizzy drinks,
  • a chainsaw,
  • and some nylon stockings.

Or maybe you want a nice toolbar, which is stricly a list (of links) and so should be marked up as a <ul>.

Here’s the code

<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About us</a></li>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>FAQs</a></li>
<li><a href=”#”>Contact us</a></li>

</ul>

Here’s how it looks as a normal list

Just adding the class “toolbar”…

<style type=”text/css”>
.toolbar li {
display:inline;
background-color:#eee;
border:1px solid;
border-color:#f3f3f3 #bbb #bbb #f3f3f3;
margin:0;
padding:.5em;
zoom: 1;

}

</style>

<ul class=”toolbar”>

<li><a href=”#”>Home</a></li>
<li><a href=”#”>About us</a></li>
<li><a href=”#”>Products</a></li>
<li><a href=”#”>FAQs</a></li>
<li><a href=”#”>Contact us</a></li>

</ul>

Here’s how it looks with the CSS styles applied

 

Posted by Gary Zhang @ 02:08:00 AM   0 Comments

0 Comments:

Tuesday, August 30, 2011

Fix: The function that will get web page title by a url as the parameter.

Source: PrimeObjects Developer Updates
Tags: 

The favorite link form and a few other forms allows users to get the title of the web page based on the URL input filled on the form. The backend function called by the javascript throught the web service API is GetHTMLTitle() in the PrimeObjects.Util.Helper.dll. We added the following script into the function to decode HTML of the tile content.

title = System.Web.HttpContext.Current.Server.HtmlDecode(title);


Posted by Gary Zhang @ 03:49:29 PM   0 Comments

0 Comments:

Monday, June 27, 2011

How to configure browser compatibility

Source: PrimeObjects Developer Updates
Tags: 

The browser compatibility is configured via the following XML.
\\PrimeObjects.ApplicationSystem.Web\BrowserCompatibility.xml

Sample contents,
<BrowserCompatibility>
  <Browser Name="IE" Version="6" OldVersion="8"/>
  <Browser Name="Firefox" Version="3" OldVersion="3"/>
  <Browser Name="Chrome" Version="8" OldVersion="8"/>
  <Browser Name="Safari" Version="5" OldVersion="5"/>
</BrowserCompatibility>

Posted by Kan Ma @ 03:58:00 PM   0 Comments

0 Comments:

Thursday, June 23, 2011

Error when creating a linked server on SQL SERVER "Invalid authorization specification"

Source: PrimeObjects Developer Updates
Tags: Linked Server , SQL Server

In SSMS, Server Objects -> Linked Servers, Right-click on SERVER2 and choose Properties.

In the properties window, click on "Security" in the left hand panel.

In the section labeled, "For a login not defined in the list above, connections will:", choose the last option "Be made using this security context:". Then specify a login and password for an account on Server2 with appropriate permissions for the task you're trying to accomplish.

Posted by Gary Zhang @ 09:08:11 PM   0 Comments

0 Comments:

SQL SERVER Named Instance, Dynamic Port & Firewall

Source: PrimeObjects Developer Updates
Tags: Dynamic Port , Firewall , Named Instance , SQL Server

Dynamic Ports

By default, named instances (including SQL Server Express) use dynamic ports. That means that every time that the Database Engine starts, it identifies an available port and uses that port number. If the named instance is the only instance of the Database Engine installed, it will probably use TCP port 1433. If other instances of the Database Engine are installed, it will probably use a different TCP port. Because the port selected might change every time that the Database Engine is started, it is difficult to configure the firewall to enable access to the correct port number. Therefore, if a firewall is used, we recommend reconfiguring the Database Engine to use the same port number every time. This is called a fixed port or a static port. For more information, see Configuring a Fixed Port.

An alternative to configuring a named instance to listen on a fixed port is to create an exception in the firewall for a SQL Server program such as sqlservr.exe (for the Database Engine). This can be convenient, but the port number will not appear in the Local Port column of the Inbound Rules page when you are using the Windows Firewall with Advanced Security MMC snap-in. This can make it more difficult to audit which ports are open. Another consideration is that a service pack or cumulative update can change the path to the SQL Server executable which will invalidate the firewall rule.

The following procedure uses the Windows Firewall item in Control Panel. The Windows Firewall with Advanced Security MMC snap-in can configure a more complex rule. This includes configuring a service exception which can be useful for providing defense in depth. See Using the Windows Firewall with Advanced Security Snap-in below.

To add a program exception to the firewall using the Windows Firewall item in Control Panel.

  1. On the Exceptions tab of the Windows Firewall item in Control Panel, click Add a program.

  2. Browse to the location of the instance of SQL Server that you want to allow through the firewall, for example C:\Program Files\Microsoft SQL Server\MSSQL10_50.<instance_name>\MSSQL\Binn, select sqlservr.exe, and then click Open.

  3. Click OK.

Posted by Gary Zhang @ 09:06:28 PM   0 Comments

0 Comments:

Subscribe
Current Posts [RSS Feed]
Latest Posts [RSS Feed]
Categories
Tags
Favorite Links
Copyright © 2011 PrimeObjects Software Ltd. All rights reserved.
Project Knowledge Management
Product Knowledge Management
Customer Knowledge Management
PrimeObjects Platform
Business Updates
Latest Improvements
Developer Updates
Mobile App Development