Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to have margin-left: 10%; margin-right: 10%; only sometimes??

Reply
Thread Tools

How to have margin-left: 10%; margin-right: 10%; only sometimes??

 
 
Cal Who
Guest
Posts: n/a
 
      05-16-2010

My website is created so that the width is not fixed. I adapt to the width
of the browser. If I have a page of text I do something like:

<div style=" margin-left: 10%; margin-right: 10%;">

so the text is set off by margins.

That's nice on my monitor's 1600 pixel wide screen.

But on a laptop (or as a user option) I'd like to change that to no margins.

Can you suggest a way of doing that without having two .css files?



Thanks





 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-16-2010
On May 16, 10:25*pm, " Cal Who" <(E-Mail Removed)> wrote:
> My website is created so that the width is not fixed. I adapt to the width
> of the browser. If I have a page of text I do something like:
>
> <div style=" margin-left: 10%; margin-right: 10%;">
>
> so the text is set off by margins.
>
> That's nice on my monitor's 1600 pixel wide screen.
>
> But on a laptop (or as a user option) I'd like to change that to no margins.
>
> Can you suggest a way of doing that without having two .css files?
>
> Thanks


http://groups.google.com/group/micro...42024fa63c0575
 
Reply With Quote
 
 
 
 
Cal Who
Guest
Posts: n/a
 
      05-16-2010

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On May 16, 10:25 pm, " Cal Who" <(E-Mail Removed)> wrote:
> My website is created so that the width is not fixed. I adapt to the width
> of the browser. If I have a page of text I do something like:
>
> <div style=" margin-left: 10%; margin-right: 10%;">
>
> so the text is set off by margins.
>
> That's nice on my monitor's 1600 pixel wide screen.
>
> But on a laptop (or as a user option) I'd like to change that to no
> margins.
>
> Can you suggest a way of doing that without having two .css files?
>
> Thanks


http://groups.google.com/group/micro...42024fa63c0575

var x;

if (self.innerWidth) // all except Explorer

x = self.innerWidth;

else if (document.documentElement && document.documentElement.clientWidth)//
Explorer 6 Strict Mode

x = document.documentElement.clientWidth;

else if (document.body) // other Explorers

x = document.body.clientWidth;



I don't understand what is happening. I debugger to see what is happening
and I pass through the x = document.documentElement.clientWidth; code. I'm
running vs2010 and IE8.

I do do this:

If (Request.Browser.Browser.Contains("Safari")) Then

Me.ClientTarget = "uplevel"

End If

That would set me to IE6 would it?

Got any idea what the problem might be?

Thanks










 
Reply With Quote
 
Cal Who
Guest
Posts: n/a
 
      05-17-2010

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On May 16, 10:25 pm, " Cal Who" <(E-Mail Removed)> wrote:
> My website is created so that the width is not fixed. I adapt to the width
> of the browser. If I have a page of text I do something like:
>
> <div style=" margin-left: 10%; margin-right: 10%;">
>
> so the text is set off by margins.
>
> That's nice on my monitor's 1600 pixel wide screen.
>
> But on a laptop (or as a user option) I'd like to change that to no
> margins.
>
> Can you suggest a way of doing that without having two .css files?
>
> Thanks


http://groups.google.com/group/micro...42024fa63c0575

Since I'm using a master page with this aspx page that contains the div I
want to change, I'm having trouble using your function since I can't pass it
the div's ID

I thought that within the div might call the function like so:

..
..
..
<script type="text/javascript">

qqload("QQQ");

</script>

</div>

</asp:Content>

Instead of "QQQ" I need to have the div's ID.

But I don't know how to do that!

What do you think?

Thanks






 
Reply With Quote
 
Cal Who
Guest
Posts: n/a
 
      05-17-2010

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On May 16, 10:25 pm, " Cal Who" <(E-Mail Removed)> wrote:
> My website is created so that the width is not fixed. I adapt to the width
> of the browser. If I have a page of text I do something like:
>
> <div style=" margin-left: 10%; margin-right: 10%;">
>
> so the text is set off by margins.
>
> That's nice on my monitor's 1600 pixel wide screen.
>
> But on a laptop (or as a user option) I'd like to change that to no
> margins.
>
> Can you suggest a way of doing that without having two .css files?
>
> Thanks


http://groups.google.com/group/micro...42024fa63c0575

I think I'm getting it. I found:
qqload(document.getElementById('<%=QQQ.ClientID%>' ));


 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Have the user enter a list of things but only have one show up first. Mufasa ASP .Net 0 12-02-2007 10:51 PM
loading problems in IE only - clipping only happens onload windandwaves HTML 1 04-10-2006 04:35 AM
My boss so cheap!! Our ASP.NET only have 256MB only! How to release request used memory when Page Unload() event raise? ABC ASP .Net 7 01-13-2006 03:23 PM
Can Ant be made to compile only read only java files? vnssoftware Java 4 12-31-2003 08:20 AM



Advertisments