the tag get underlined in blue color and it gives me warning like this:
The 'StructureMap' element is not declared.
This is happening because you are trying to add it in a Config file. Has this been a plane XML file saved as *.xml file, all would be good.
Config files have standard format and defined elements to show.
For your case, we would need to do it inside
Embedding StructureMap configuration into the App.config file
<section name="StructureMap" type="StructureMap.Configuration.StructureMapConfigurationSection,StructureMap"/>
Documentation details here: StructureMap - StructureMap Home Page