Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Div canDiv can't be center aligned in the ascx file?
Previous
 
Next
New Post
2/9/2009 11:16 PM
 

I'm working on a DNN site and I'm using version 4.9.0. When I tried to create a center-aligned div using auto margin, the div is still aligning to the left.

The css file:

.outside{width:100%; background-color: #FFFFCC; }
.inside{ width:300px; height:300px; margin:0 auto; background-color:#CCFF99;} 

and the ascx file:

<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<%@ Register TagPrefix="dnn" TagName="LANGUAGE" Src="~/Admin/Skins/Language.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>
<%@ Register TagPrefix="dnn" TagName="NAV" Src="~/Admin/Skins/Nav.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TEXT" Src="~/Admin/Skins/Text.ascx" %>
<%@ Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/Admin/Skins/BreadCrumb.ascx" %>
<%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LINKS" Src="~/Admin/Skins/Links.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>
<%@ Register TagPrefix="dnn" TagName="STYLES" Src="~/Admin/Skins/Styles.ascx" %>
<link href="hp.css" rel="stylesheet" type="text/css" />

<div class="outside">
  <div class="inside"></div>
</div>

 

The center-aligned div works fine in the html file but doesn't work in ascx file. Am I missing something? Is there a way to do center alignment using margin ?

 

 
New Post
2/10/2009 3:31 AM
 

Is the skin XHTML? Please note that if the HTML is the skin will not be unless you use a skinname.doctype.xml file.

(check the DNN 4.9.1 skin Minimal Extropy for an example)

 
New Post
2/10/2009 12:54 PM
 

Have you tried adding a {text-align: center} property to the .outside class?

You'll probably have to add a {text-align: left} property to the .inside div to reset the text alignment, though.

 
New Post
2/10/2009 2:52 PM
 

Thanks for your help guys.

To Timo: Yes it is XHTML. And the head part of the page is fully copied from Minimal Extropy. So I don't know why it doesn't work.

To TFawcett: I tried text-align and it did work. But I really want to use Margin instead of text-align. Is it just not possible to do it in an ascx file or it's just me did something wrong?

 
New Post
2/10/2009 7:19 PM
 

The head of the html skin does not help, you must have the "myskinname".doctpye.xml file or the skins doctype will not be XHTML

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Div canDiv can't be center aligned in the ascx file?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out