Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2009, 12:16 PM
Authorized User
 
Join Date: Apr 2008
Posts: 26
Thanks: 6
Thanked 0 Times in 0 Posts
Default Wrox Blog editor image question

I have a question in Wrox blog code again..

FCKeditorV2:FCKeditor ID="txtBody" runat="server" BasePath="~/FCKeditor/" ToolbarSet="WroxBlog" Width="500px">
</FCKeditorV2:FCKeditor>


When entering text into blogs, the editor allows to add images and nicely link into any location! It also allows to adjust an image where text could be placed under the image, to the left of the image an other bunch of choices.

After querying the data from the database, the blog body text is assign to a label.text to display on the page. But my problem is, no matter how the image is formatted to show text left to the image, it always comes bottom of the image.
Is this something do with label.text or is there a another way to do this?

Thanks for an answer.

Last edited by norman001; February 22nd, 2009 at 12:19 PM..
 
Old February 22nd, 2009, 12:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The editor just collects and displays HTML. It's up to the final page to display it correctly. Maybe you have CSS or HTML rules in the final page that mess with the layout? For example, maybe the image doesn't fit in the spot where it's placed and is moved to another location?

What does the final HTML in the browser look like?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 22nd, 2009, 02:13 PM
Authorized User
 
Join Date: Apr 2008
Posts: 26
Thanks: 6
Thanked 0 Times in 0 Posts
Default Wrox Blog editor image question

Hi Imar,

You are absolutely right! My CSS file is messing up! I have the following in my CSS file.If the image properties are explicitly added within img tag, I don't understand why it is picking up from the CSS file. If I change vertical-align property to "right", the blog picture comes at the correct position. I can't change what is in CSS file as it will impact the whole website. What else I could do here?
img
{
border:0;
vertical-align:middle;
}

The html file for the blog page looks like this..
<p><imgborder="2" hspace="2" vspace="2" align="right" src="http://tbn0.google.com/images?q=tbn:yz7s82kyTJ4DYM:http://www.fs.fed.us/r2/psicc/coma/images/Picture_canyon.jpg" width="130" height="75" alt="" />Testing text from the web... The purpose behind &quot;greeking&quot; is to force your reviewers to ignore the text and just focus on the design elements on the page. Every designer has experienced the review session where the reviewers found 13 typos in the sample text that was used, or decide..</p>.<br/>
 
Old February 22nd, 2009, 02:42 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I can't change what is in CSS file as it will impact the whole website.
This means you'll have to fight the CSS rules you set in your CSS file somehow.

Consider this:

img
{
vertical-align:middle;
}

Because of the generic selector (img) this applies to ALL images in your site, unless specified otherwise. There are a few ways around this, for example:

1. In-line styles take precedence over the element selector. So this should work (or at least override the previous declaration):

<img src="Tralala.jpg" style="vertical-align: top;" />

2. Be more specific. E.g. create a selector that's more specific than the img selector. For example, if your image is in a <div> with an ID of MainContent you can target the image like this:

#MainContent img
{
vertical-align:top;
}

Finally, you can use !important to overrule previous settings:

img
{
vertical-align:top !important;
}

However, when you add this in the same CSS file as the img selector, you might as well change the original definition.

Hope this helps...

Imar

BTW: you may need to turn your head 90 degrees to make all of this work. There's typically no "right" in a vertical direction.... ;-)
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 22nd, 2009, 07:42 PM
Authorized User
 
Join Date: Apr 2008
Posts: 26
Thanks: 6
Thanked 0 Times in 0 Posts
Default Wrox Blog editor image question

Thanks! I got it working by adding the following to CSS file..
Added another div tag wrapping around the blogBody text.. with this..
<div id="MainContent">

#MainContent img
{
border:0;
vertical-align:top;
float:right;
}

Everything works now great!
 
Old February 23rd, 2009, 03:40 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrox Blog in C# madAlan BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 22 June 12th, 2011 04:09 AM
Wrox Blog Question - LinkButton norman001 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 14 February 7th, 2009 03:03 PM
Wrox Blog tblessed23 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 16 May 14th, 2007 04:08 PM
Wrox Blog: Viewing individual blog entries Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 May 7th, 2007 12:06 PM
Blog Editor and Calendar sclaggett BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 September 15th, 2006 08:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.