1
Page content,CSS StylesheetCSS:使用寬度百分比定位子表?
當您訪問頁面內容鏈接時,請拿下面的示例代碼並提交它。您會注意到子表source_code
沒有一直延伸到右側。如果我將width: 100%
添加到syntax_table
類中,它可以解決問題,但source_code
表正確對齊,我無法將其移動到左側。
我花了大約2個小時試圖解決它,我現在需要一些幫助。
下面是一些C#示例代碼:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
namespace Test1
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
/// <summary>
/// Calculate method.
/// </summary>
/// <param name="sender">Sender</param>
/// <param name="e">Event Arguments</param>
private void btnCalculate_Click(object sender, RoutedEventArgs e)
{
double weight;
int heightf, heighti;
Double.TryParse(this.txtWeight.Text, out weight);
Int32.TryParse(this.txtHeightF.Text, out heightf);
Int32.TryParse(this.txtHeightI.Text, out heighti);
if (!(heightf >= 1))
MessageBox.Show("A person is at least 1 foot tall.");
else if (!(weight >= 1.0))
MessageBox.Show("A person cannot weigh nothing.");
else if (heightf >= 12)
MessageBox.Show("A person is not taller than 12 feet.");
else
{
double kg = weight * 0.45359237;
int height = heighti + (heightf * 12);
double bmi = weight/(height * height) * 703;
double gbmi = Math.Round(bmi, 1);
this.txtBMI.Text = bmi.ToString("n1");
}
}
}
}
重讀原來,我不認爲我完全理解這個問題 - 您可以發佈生成的HTML/CSS代碼,所以我可以把它放在一個頁面,然後看到問題在發揮? 謝謝! – Dracorat