G
Guest
I'm not sure if this is the right place to ask this question, but if there is
a better place, I cannot find it.
I have a web that uses Master Pages. The basic layout is acieved using
<table> - this method is deprecated and I am trying to convert it to use CSS.
I understand CSS pretty well, and did a small pilot to see how it would all
work. Then I decided to do it on the real project.
Let's just take one small simple example that illustrates the problem. Let's
say I have within my Master Page a div, coded as follows:
<div id="logodiv" runat="server"><img src="mylogo.jpg" /></div>
And now let's suppose in the CSS file I have something like:
#logodiv { vertical-align: middle; float: left }
All should be hunky dory, but alas, it isn't because by the time the browser
sees the HTML they id of the div isn't logodiv anymore but, say _ctl0_logodiv.
Obviously, I could change the CSS file to hard code _ctl0_logodiv instead of
logodiv, but this is clearly not good.
Similarly, I could put in the .cs file a statement like:
logodiv.style = "vertical-align: middle; float: left";
But this defeats the purpose since I am trying to put the STYLE in the CSS,
and the code in the .cs and the content in the .master
How am I supposed to resolve this problem?
a better place, I cannot find it.
I have a web that uses Master Pages. The basic layout is acieved using
<table> - this method is deprecated and I am trying to convert it to use CSS.
I understand CSS pretty well, and did a small pilot to see how it would all
work. Then I decided to do it on the real project.
Let's just take one small simple example that illustrates the problem. Let's
say I have within my Master Page a div, coded as follows:
<div id="logodiv" runat="server"><img src="mylogo.jpg" /></div>
And now let's suppose in the CSS file I have something like:
#logodiv { vertical-align: middle; float: left }
All should be hunky dory, but alas, it isn't because by the time the browser
sees the HTML they id of the div isn't logodiv anymore but, say _ctl0_logodiv.
Obviously, I could change the CSS file to hard code _ctl0_logodiv instead of
logodiv, but this is clearly not good.
Similarly, I could put in the .cs file a statement like:
logodiv.style = "vertical-align: middle; float: left";
But this defeats the purpose since I am trying to put the STYLE in the CSS,
and the code in the .cs and the content in the .master
How am I supposed to resolve this problem?