Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my visual basic mvc application I have this code:

@<div Class="isa_success" id="bloc2">
<i Class="fa fa-check"></i>
@Html.Raw("Плаката се редактира от потребител " + Model.UserName + ".")
</div>
As a result I get green rectangle with an icon and text in it like this:
|(3spaces)icon(3spaces)text|
I want to move the icon to the left corner and to to make "Model.UserName" to be bold.
Can you help me?

What I have tried:

I tried changing margin and padding of the "i" element but without success.
Posted
Updated 18-Jan-19 2:20am
v3
Comments
Richard Deeming 18-Jan-19 9:51am    
@Html.Raw("Плаката се редактира от потребител " + Model.UserName + ".")

That looks like a bad idea. The Model.UserName won't be properly HTML-encoded, which could open your site up to an XSS attack, albeit one that would only work on the user who initiated it.

Why not use:
Плаката се редактира от потребител @(Model.UserName).
MadMyche 18-Jan-19 11:21am    
Is this utilizing Font-Awesome?

1 solution

It can only be assumed that the icon you speak of is within that Html.Raw line; and I am assuming that this is the code of the View page that you are using. You may want to update your question (using the "Improve Question" widget) to add in the actual HTML markup that is generated (use "View Source" in the browser to get it)

The problem you want to fix appears to be more markup related than programming. Looking at the code from the View I came up with this:
1. The <i></i> element has no content within it, so I eliminated it.
2. Try using the basics of CSS first; inject in some inline styles

You may need to experiment with this, but it should give you a start. Just change the CSS values within the style attribute on your <div>
HTML
@<div Class="isa_success" id="bloc2" style="text-align: left; font-weight:900;">
     @Html.Raw("Плаката се редактира от потребител " + Model.UserName + ".")
</div>
 
Share this answer
 
v2
Comments
Richard Deeming 18-Jan-19 9:47am    
I suspect the icon is the <i class="fa fa-check"></i> line. That's a standard "FontAwesome" element. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900