Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Mar 17, 2010

CSS styling



OK I'm working on my individual iteration style of my web page. I did a little styling in Is247 but its been awhile so i don't really remember. I searched the web for some styling tips and i found that w3schools.com has a good tutorial to get you started. I worked through some of the examples which is good practice and it gave me some ideas on how i want to setup my website. the website has its own editor where you can fidget around with it.

I noticed that i have to play around with Css code so i can get it to do exactly what I want. For my final project I'm thinking about adding a several images to the style also maybe a specific background color and specific positioning of my APIs.

I still trying to get the styling of my web page down. I am going to continue to surf the web for some other examples hopefully i will have it down pack for the final individual project.

Mar 5, 2010

Div tag scroll bars

I'm not sure if any of you have run into this problem but when I was outputting my XML to my web site I was constantly overflowing the div window with results. At first I was trying to minimize the results by creating for loops that only printed a certain number of results. While this was effective it didn't allow me to have as much content as I wanted to display. However, there was a solution.

I did a search in Google for "Scroll bar DIV tag" I was surprised by the amount of results but I was more surprised at how simple it was. You can check out the results of the search here. Anyway the only thing I had to do was to put this simple bit of code into my style sheet.

overflow: auto;

That's it, not too complicated but oh so effective for presenting tons of results in a small window in order to fit into web site. This little gem allowed me to stuff 25 news stories into a small widow within the page. Here is the results.


Feb 17, 2010

Header for Website

I wanted a standard header for our website that shows up on every page. I knew that the style sheet could help me achive this. It has been a while since I wrote a .css file.

I first tried to have the style sheet just float the elements of the header. Then I was using an absolute positioning. But this involved a lot of code and jocking back and forth between the style sheet and the website to look at each change.

Then I thought there had to be an easier way. I finally looked at the book to see how other sites handled this. It is an Image that is called from the html file. The Style sheet holds the other information like positions and colors about the header. DUH!

I could have used this tutorial too.

Nov 30, 2009

CSS Ideas

I know that Matt just gave some useful tips in his blog about screen resolutions. I thought that I would give you a couple that I used for our group project. The first issue that we had was trying to make rounded corners for our dive so the page didn't look so boxy. There are a number of ways that you can do this and we first started off by using 2 images that sat in the background.

The problem we had is that the images were bigger than we needed them to be and if we wanted to change the width of the div we had to change the picture. The solution to the problem was to create 4 tiny images of rounded corners and create a div for them. There are many websites that will generate the images for you such as RoundedCornr and Spiffy corners. I actually used RoundedCornr to generate pictures for me then used a simple code to create it. The code was almost the same for every image. It just depended on whether it was left or right.


The other problem that we were facing was the page showing up differently when viewing from different monitors. The way that I attempted to solve this problem was instead of just using the width element, I used a min-max property. I found the idea while searching on the internet from the website CSS Tricks. The idea is that your page "shrinks to 780px to accommodates users with 800×600 resolution, with no horizontal scroll and grows to 1260px to accommodates users with 1280×768 resolution and everything in between". The CSS is actually very simple too. The code just requires two lines in your CSS:


Of course I have not been able to try if this works out because right now I only have my laptop working. I will not know until class if this solves the problem.

Oct 31, 2009

JavaScript Switch Statement and Hiding elements

I have been planning to hide some images in my personal project and cycle through them when a button is clicked but never managed to get to that. However, after placing a Utube video on the Home page of our group project and then having one of our group members add Weather information, via an API, we discussed having one present on our Home page and the other present on a different page.

So I decided to experiment with hiding / un-hiding the Utube video and Weather forecast on our website. Initially, I started by using some IF statements but that got a little messy so I decided to use a JavaScript switch statement instead. This is what I came up with:



Basically, the switch statement takes the variable ‘title’ and depending, on what its value is, executes some statements. This is so much cleaner than using a bunch of IF / ELSE statements.

If ‘title’ equals ‘Trails’ or ‘Events’ then specific things are preformed according to the code defined in the relevant section, otherwise, the default section is executed.

The only other thing I had to do to hide / un-hide the Utube video or Weather forecast was to define a CSS class of ‘hidden’ or ‘unhidden’ and place the action (hide / un-hide) in the proper section of the switch statement.



The only thing you need to decide is whether to use visibility: hidden or display: none. Visibility hidden hides the element but it still takes up space and display: none removes the element completely from the document. When un-hiding an element you can either use display: block or display: inline. Display block only allows one element of its kind to be displayed (starts a new paragraph). Display inline allows multiple elements to be displayed on one line. There are a few more display properties but I am not currently concerned with them.

Oct 14, 2009

CSS Page Widths

Through my light experience in web design, I have been frustrated with setting my page widths. Why is it that when I design my page in the lab it looks great but when I look at it on my laptop at home it suddenly looks huge!? I have tried using several combination's of fixed and percentage widths, but nothing ever comes out looking like I want it to.

With the use of max and mix page widths, you can change the way your page is rendered based on the users browsers settings. The example I found is on the 'CSS Tricks' website. They have a page called "Perfect Fluid Width Layout" where the show a good example of a page that varies in width. Their min-width is set to 780px for those users with a low resolution screen and the max-width is set to 1260px for users with high resolution screens.

I think the real trick to their page comes with their combination of padding and width settings. With the main div box has a variable width setting, the boxes within it have a fixed width. Their spacing is determined by the padding settings. Both are then maintained while the browser changes size. I might have to practice this method more to fully understand it, but on paper it makes sense. I recommend checking out their page and use firebug to see how it works.

Oct 8, 2009

Create your own slide show with DHTML and CSS

I've worked with HTML, XHTML, XML and even VRML but I hadn't heard of DHTML (Dynamic HTML) until I went looking for a way to do a slide show with some jpg images. My main problem is that I would like to keep everything separate as the Head First book suggests. I could just use the "img" tag in my HTML document like the Head First example from chapter 1. However, I figured there might be an easy (or at least not too difficult) way of doing a slide show and keeping everything in their respective files.

I found this site when I searched on slide shows. It looks like this will do what I want however; it is all in the HTML document so I would have to scrape it out and put everything in their own files. That shouldn’t be a problem because the code is separate and it looks like it would be easy to move everything.

The other option I have been considering is to just start with everything in my HTML page like the book and then move things one at a time. I am not sure at this point what I will do but I got some good ideas and found more information from W3schools. I think this site may actually be one of the best reference sites, for what we are doing, that I’ve found so far.

Oct 7, 2009

Adobe Air



The Adobe® AIR™ runtime lets developers use proven web technologies to build rich Internet applications that run outside the browser on multiple operating systems.

Business benefits
Adobe AIR offers an exciting new way to engage customers with innovative, branded applications, without requiring changes to existing technology, people, or processes.

With the Adobe® AIR™ runtime, you can deliver branded rich Internet applications outside the browser that give you a closer connection to your customer.
Adobe AIR uses the same proven, cost-effective technologies used to build web applications, so development and deployment is rapid and low risk. You can use your existing web development resources to create engaging, branded applications that run on all major desktop operating systems.
The benefits are extensive. By using Adobe AIR as part of your RIA strategy, you can boost productivity, extend your market reach, enhance customer satisfaction, improve customer retention, lower costs, and increase profits.
Business benefits
Companies like eBay, AOL, and NASDAQ are already using Adobe AIR to deliver engaging RIAs to their users' desktops. With Adobe AIR, you can:
Establish a more persistent connection with existing customers
Deliver fully branded experiences with desktop functionality
Leverage existing personnel, processes, and infrastructure
Develop and deliver RIAs efficiently using proven Adobe technology
Increase the ROI of your web investments

Commercial considerations
Adobe offers its own commercial development tools for Flex-based AIR development. Adobe's Flex IDE, which we tested briefly, is built on top of the open-source Eclipse IDE and includes robust support for drag-and-drop visual Flex application design. AIR development tools have also been incorporated into Dreamweaver CS3. Adobe has fortunately made its own tools entirely optional, so AIR developers don't have to worry about getting locked into expensive commercial design software.


AIR support is already being integrated into third-party commercial development tools such as Aptana Studio. AIR developers can also use a conventional text editor in conjunction with Adobe's free command-line tools. Flex and AIR development can be done entirely with standard text editors; in fact, most of the programs we created during our tests were written in Vim on Ubuntu Linux and then compiled and tested on Windows in VMware.

Before we get into the nitty-gritty of Adobe AIR, it helps to understand a few key terms and break down what it means to be a "cross-operating system runtime" that can run desktop applications.
AIR is, first of all, a runtime engine at its most basic. A runtime engine is simply computer software that other applications need to use in order to run properly; it translates language within a program into machine language, the simple, lowest level language (essentially 0s and 1s) the central processing unit (CPU) can understand. Programs that run on Java, for example, require the Java Virtual Machine runtime engine installed on the computer. Without it, your computer wouldn't be able to make use of the same graphical user interface (GUI) that you're used to using now. A GUI, also known as a human-computer interface, is the combination of windows, icons, text and menus that we can change with a mouse or a keyboard. Even your operating system can be considered the mother of all runtime engines, since every application on your computer depends on the processes of the operating system.
So when Adobe describes AIR as a "cross-operating system runtime," they just mean that AIR is a runtime that can work on any computer, regardless of the operating system. Different operating systems use different languages; a program running on Mac OSX, for instance, won't look the same as the same program running on Windows XP. Applications built with Adobe programs such as Flash or Flex will use the AIR runtime to display -- because AIR comes the with the open-source WebKit HTML renderer, Web-like content can display on the desktop. That's the big difference between something like a Flash player and AIR: While Flash works over the Internet and in your Web browser, applications running off of AIR are based on the desktop and don't necessarily require a browser to work.


Oct 1, 2009

JavaScript / CSS / DOM image magnifier

I found a rather interesting site while looking for a template for our group project. I don’t recall hearing about or seeing anything like this. This scrip allows you to add a magnifier to your pictures. The code runs on a mouseover event which turns on the zoom feature. This code is also useful if you have a low and high resolution picture of the same image. You can load the low resolution image on your page and reference the bigger picture when you use the zoom feature.

You can increase the zoom by using the keyboard up arrow or decrease the zoom by using the keyboard down arrow. The left and right arrow keys decrease or increase the zoom window size. There are more options available if you look at the script: tjpzoom.js

I haven’t added this to a site yet but I’m guessing that the zoomed image is only as good as the original picture. I plan to put this on my list of things that I want to experiment with when I have more time. I would add the feature to the blog but I don’t think it works as a post. However, here is a sample of what it looks like:

You should notice that I zoomed in on one of the boy's heads. I am sure the Blog won’t do the image justice so you will have to visit this site to see how good this looks.


I don’t really surf unless I am looking for something and then it usually involves looking for something specific. I am not sure how I even got to this site but I think it is very interesting!

Sep 17, 2009

Editors and References

It’s been a couple years since I've had to write HTML and CSS from scratch. I currently maintain our company website but that is much easier than starting from scratch. I decided to go looking for a good "free" html editor and found a LONG list. “This page lists free HTML editors, Web editors, WYSIWYG editors, web site builders, as well as specialized editors optimized for Cascading Style Sheets (CSS) or even the numerous web scripting languages such as PHP, Perl, Java, JavaScript, ASP, etc.” Not only are there a number of editors but there are, of course, more links to other editors and more free stuff.

After finding this site and looking at all the choices I decided to just stick with Notepad++ rather than trying something new. Notepad++ offers so many good features:


  • The text is displayed in different colors depending on what it is
  • When you select an opening the closing is automatically highlighted.
  • There are line numbers which come in handy when you get an error that references a particular line number.


    I am sure there are many other benefits to using Norepad++ but one of the main reasons I like it is because it doesn't add any extra space(s) or code to your project. The code is as neat and clean as you make it.

    Also, I stumbled on a few good reference sites while I was looking for an HTML editor. It still amazes me how much good information is on the web! I found quite a few good explanations and references for JavaScript, CSS and XHTML. I also found a nice reference site for php while trying to figure out how to comment out a number of lines of code.