0

我想在我的 portlet 中从右到左对齐。在普通的 html 页面中测试它是可以的。但是当我将它放入 Liferay portlet 时,它不是从右到左,而是从左到右显示。这是我的代码:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.patientInfo
{
    direction:rtl;
    border:2px solid;
    width: 100%;
}
.titile
{
    font-weight:bold;
    padding-right:5px;

}
p
{   
    display:inline; 
}
.patientName
{
    background-color:#0CF;
    direction:rtl;
}
.doctorName
{
    background-color:#0CF;
    direction:rtl;  
}
</style>
</head>
<body>
<div class="patientInfo">
<div class="patientName"><p class="titile">نام بیمار:</p><p> اکبر اسدی</p></div>
<div class="doctorName"><p class="titile">نام دکتر:</p><p>مریم اخیانی</p></div>
</div>
</body>

问题是什么?

4

1 回答 1

0

将样式表类放在单独的 css 文件中并将其注册到 中liferay-portlet.xml,以便 Liferay 加载它。这是更好的方法,因为 liferay 切断了头部标签。

liferay-portlet.xml:

<header-portlet-css>/css/main.css</header-portlet-css>
于 2012-05-06T22:09:45.847 回答