p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 11th, 2008, 11:29 PM
epc epc is offline
Registered User
Points: 34, Level: 1
Points: 34, Level: 1 Points: 34, Level: 1 Points: 34, Level: 1
Activity: 10%
Activity: 10% Activity: 10% Activity: 10%
 
Join Date: Jul 2008
Location: Milwaukee, Wisconsin, USA
Posts: 7
Thanks: 4
Thanked 0 Times in 0 Posts
Default Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274)

How do you create a zero border linked image utilizing a user control, <asp:Image> control, and an external style sheet that can be viewed site wide?  

Said another way...

I understand how the inline example works with the default zero border (style="border-width:0px;"), but how do I bypass the inline version with the external stylesheet based on the two themes discussed in the book?  

I also wanted to mention that I am brand new to web programming and I have found this book to be an excellent teaching tool.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 12th, 2008, 05:37 AM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

Hi epc,

Because the style for the image is defined in-line, it takes precedence over any other CSS that has been set, either with an embedded or an external style sheet.
You can, however, override with !important (doesn't mean "not important" as it would in C# or JavaScript, but means "is important"). You can apply it like this:
Code:
img
{
  border: 2px solid red !important;
}
This overrides the in-line style on an image:

<img src="Plough.jpg" style="border: 9px solid green; />

So even if the image has an in-line style for a green, thick border, the img selector overrides this and gives the image a thinner, red border.

For more info: http://webdesign.about.com/od/css/f/blcssfaqimportn.htm

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table woes - <th> inside a <thead>. kennethjaysone BOOK: Beginning Web Programming with HTML, XHTML, and CSS 0 November 28th, 2007 02:59 AM
<asp:Image /> & hspace Poltroon BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 July 5th, 2006 03:53 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
a problem in book<<beginning asp.net using vb>> luoware ASP.NET 1.0 and 1.1 Basics 3 December 8th, 2003 09:32 PM
<<ASP.NET Security>>,download files in chapter 8 alaix All Other Wrox Books 1 July 24th, 2003 11:29 AM



All times are GMT -4. The time now is 11:33 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc